magento2 – Magento 2: Switches the entire group in system.xml based on field in another group

I have created two groups in system.xml.
I need to show / hide Group 2, depending on the Module Enable field in Group 1.
However, if I use the following code, it hides both sections and does not save anything in the configuration table.
Please help

a soft one Asoft_Fancypop :: config Magento Config Model Config Source Yesno Asoft Fancypop Model Config Settings Popup ShowOn Asoft Fancypop Block Adminhtml System Config Date Asoft Fancypop Block Adminhtml System Config Date Allowed file types: PNG, GIF, JPG, JPEG. Asoft Fancypop Model Config Backend Image Popupbg asoft / fancypop / background Required input confirmation number Required input confirmation number 1

To populate a field from the parent form to the inline entity form

I have two content types – Employee and Project.

Both forms have inline entity forms with references to the contents of each other

  • When a user creates an Employee node, he can add projects to which he has participated. When a user creates a Project node, he can add a list of the people who worked on this project.

However, I would like to pre-populate the title of the parent node in IEF. How can I do that?

For example, if I create a Project Content Type Project, I'll add some people. When saving the project node, these employees are mentioned on this project node. There is no link to this project in the employee node.

I would like to pre-populate the project title field in the IEF project of the employees when saving the project node and vice versa.
It sounds a bit like recursion and I'm not sure my explanation is clear, but I did my best.

How do you get the field in a model from another model in Django?

I have two models in an app the first model is that I create a guide, the guide is created with one user(and some data), that is, I need to create a low privileged user and register him as a consultant.

The second model consists of creating a consultant with some data and I assign a consultant (a consultant can have only one consultant, the consultant does not need this). user).

This one models:

Class Advisor (Models.Model):
user = models.ForeignKey (User, on_delete = models.CASCADE, verbose_name = & # 39; user & # 39;)
first_name = models.CharField (max_length = 100, verbose_name = & # 39; name & # 39;
last_name = models.CharField (max_length = 100, verbose_name = & # 39; surname & # 39;
created = models.DateTimeField (auto_now_add = true, verbose_name = & # 39; creation date & # 39;
updated = models.DateTimeField (auto_now = true, verbose_name = & 39; release date & # 39;

Class objective:
verbose_name = & # 39; Consultant & # 39;
verbose_name_plural = & # 39; Consultant & # 39;

def __str __ (self):
Return values ​​self.erst_name


Class Recommended (Models.Model):
first_name = models.CharField (max_length = 100, verbose_name = & # 39; name & # 39;
last_name = models.CharField (max_length = 100, verbose_name = & # 39; surname & # 39;
adviser = models.ForeignKey (Adviser, on_delete = models.CASCADE, verbose_name = & # 39; guidebook & # 39;)
created = models.DateTimeField (auto_now_add = true, verbose_name = & # 39; creation date & # 39;
updated = models.DateTimeField (auto_now = true, verbose_name = & 39; release date & # 39;

Class objective:
verbose_name = & # 39; recommended & # 39;
verbose_name_plural = & # 39; recommended & # 39;

def __str __ (self):
Return values ​​self.erst_name

In one app otherwise I have one modelis that a consultant assigns ratings to his assigned advisors (in their active session), and the problem arises that I am told that they will not be assigned to the registered counselor, so I try it ForeignKey of the model of the consultant (To advise) that is related to the consultation model (consultantGet yours user and so in the Recommended = Models.OneToOneField of the model AdministrationOfCounseled the adviser's advisers at the active meeting.

This one model AdministrationOfCounseled:

Class AdministrationOfCounseled (models.Model):
adviser = models.OneToOneField (Adviser, on_delete = models.CASCADE, verbose_name = & # 39; counselor & # 39; default = consultant)
advised = models.OneToOneField (recommended, on_delete = models.CASCADE, verbose_name = & # 39; counseled & # 39 ;, unique = true)

# Qualification fields .....

Class objective:
verbose_name = & # 39; recommended administration & # 39;
verbose_name_plural = & # 39; administration of advice & # 39;

def __str __ (self):
return str (& # 39; & # 39;)

So tell me if this is the best or if there is another better way or not to do so

Thanks for your answers!

Append a custom field to post content

I'd like to append my custom field named LINK (example: http://domain.com') to the end of the post so I can use a standard theme again.

Apparently, this answer to the question "mass shift (or copy) from a custom field to the post content?" That's what I need except that it replaces all the post content instead of attaching it.

Can someone help me to change this code to attach it to the post content?

add_shortcode (& # 39; update-posts-from-custom-fields & # 39 ;, & # 39; upfc_fields321 & # 39;);
Function upfc_fields321 () {
$ args = array (
& # 39; # 39 & meta_key; => & Custom_field & # 39 ;,
& # 39; # 39 & meta_query; => array (
Array (
& # 39; key & # 39; => & Custom_field & # 39 ;,
& # 39; value & # 39; => & # 39 ;,
& # 39; compare & # 39; => & # 39; = & # 39 ;,
)
)
& # 39; # 39 & POST_COUNT; => & # 39; -1 & # 39;
);
$ the_query = new WP_Query ($ args);

if ($ the_query-> have_posts ()) {
$ post_counter = $ save_counter = $ delete_counter = 0;
while ($ the_query-> have_posts ()) {
$ the_query-> the_post ();
global $ post; // not sure if this is needed, but it can not hurt
Echo & # 39;
        

& # 39 ;. the title() . & # 39;

& # 39 ;. the content() . & # 39;
& # 39 ;; $ post_counter ++; $ post-> post_content = get_post_meta ($ post-> ID, & # 39; custom_field & # 39 ;, true); $ post-> post_content_filtered = & # 39; & # 39 ;; $ post-> post_excerpt = & # 39; & # 39 ;; // uncomment the next line if you want to make changes // wp_update_post ($ post); $ save_counter ++; // uncomment the next line if you want to delete the meta key (useful if you have too many posts and want to batch them). // delete_post_meta ($ post-> id, & # 39; custom_field & # 39;); $ delete_counter ++; Echo & # 39;
& # 39 ;. the content() . & # 39;
& # 39 ;; } } else { // No entries found }; echo & # 39;
Processed Posts: & # 39 ;. $ post_counter. & # 39;
Saved Posts: & # 39 ;. $ save_counter. & # 39;
Meta deleted from: & # 39 ;. $ delete_counter. "Contributions"; wp_reset_postdata (); }

ac.commutative algebra – presence of two field extensions whose tensor product is not a field

Works for an algebraically closed field $ F $ There are two field extensions $ F subset K, L $ so that the tensor product $ K otimes_F L $ is not a field?

If $ F $ is not closed algebraically, then there is a finite field extension too $ K $so obvious $ K otimes_F K $ is not a field since the kernel of multiplication $ mu: K otimes_F K to K $, $ mu: x otimes y mapsto xy $ is not trivial (for dimensional reasons).

In SharePoint 2013, a duplicate field name "StartDate" was found

You can not vote for your own post
0

After completing the migration from SharePoint 2010 to SP2013, job jobs did not display any job jobs. Therefore, we disabled the feature and enabled it at SiteCollection level. You can then view the custom timer job under Timer job definition, except for a custom timer job that we disabled, and when the Web-level feature is enabled, you see the error. A duplicate field name "StartDate" was found in SharePoint 2013.

There is no problem in SharePoint 2010, but after the migration to SharePoint 2013, a duplicate field name "StartDate" was found.

We've created two custom list definitions (Activity Tasks and Workflow Task) and created the StartDate column with the following field attributes in Schema.xml
Enter the image description here

Also, many custom ContentTypes have specified the StartDate columns as mentioned in the Elments.xml file

Enter the image description here

This StartDate field was used in many places in the code. Can you help with this problem as you can fix this?

How do I rewrite the field of a Drupal 8 view with TWIG?

In Drupal I have created a view with the machine name cgv_product,

This view contains the Product Name and Custom Text fields.

In the Custom Text field, the {{ Surname }} A token is available to display the product number.

I created a template named view-view-fields - cgv_produit.html.twig but it works when I put the token {{ Surname }} The token is not rendered in the code.

How can I display the product name token in my template?

view-view-fields - cgv_product.html.twig

How can I output a string in custom posts from a custom field?

I use a function (maav_portfolio_infinite_loading) to load more custom posts on a page via Ajax.

I just want to be able to load from a specific category that I can set on the main portfolio page. I have created the field and everything works except the category filter. If I introduce it manually (& # 39; portfolio_category & # 39; => web & # 39;), it works, but if I try to repeat it, it does not work for some reason.

I need the $ select_categ in & # 39; portfolio_category & # 39; to repeat.

The function below is in functions.php.

Function maav_portfolio_infinite_loading () {
$ select_categ = Maav_Helper :: get_post_meta (& # 39; select_categ & # 39 ;, & # 39; & # 39;);

$ args = array (
& # 39; # 39 & post_type; => $ _POST['post_type'],
& # 39; # 39 & posts_per_page; => $ _POST['posts_per_page'],
& # 39; # 39 & orderby; => $ _POST['orderby'],
& # 39; order & # 39; => $ _POST['order'],
& # 39; # 39 & paged; => $ _POST['paged'],
& # 39; # 39 & portfolio_category; => $ select_categ,
& # 39; # 39 & post_status; => array (& # 39; publish & # 39;)
);

$ style = isset ($ _POST.)['style'] ) $ _POST['style'] : 1;
$ overlay_style = isset ($ _POST['overlay_style'] ) $ _POST['overlay_style'] : & # 39; internal text & # 39 ;;
$ i = ($ args['paged'] - 1) * $ args['posts_per_page'];
$ count = $ _POST['count'];
$ image_size = $ _POST['image_size'];
$ overlay_animation = $ _POST['overlay_animation'];
$ maav_query = new WP_Query ($ args);

if ($ maav_query-> have_posts ()):
include (get_template_directory (). & # 39; / loop / portfolio / style - & # 39;. $ style. & # 39; .php & # 39;);
endif;
wp_reset_postdata ();
wp_die ();
}

Thank you in advance!

Custom field values ​​will not be updated unless I click "Refresh" twice

I wanted to store custom field values ​​in revision history. The following URL had a code that helped me (http://carolandrews.co.uk/saving-revisions-for-custom-post-type-meta-data/).

The problem is that I have to click the Refresh button twice for it to appear in the version history. If you click on "Update" once, the values ​​are updated correctly. They will only be displayed in revision history if you do not double click on them.

Here is the code:

Function ca_members_fields () {global $ CustomPress_Core; $ member_fields = $ CustomPress_Core-> get_custom_fields_set (& # 39; book & # 39;); return $ member_fields; }

add_filter (& # 39; _wp_post_revision_fields & # 39 ;, ca_member_fields & # 39 ;, 10, 1);

Function ca_member_fields ($ fields) {
$ members_fields = ca_members_fields ();
foreach ($ Members_fields as $ fieldname => $ Members_field) {
$ Fields['ct_'.$fieldname] = $ members_field['field_title'];
}
$ Return fields;
}

Function ca_field ($ value, $ field_name, $ post) {
$ members_fields = ca_members_fields ();
foreach ($ Members_fields as $ fieldname => $ Members_field) {
if ($ fieldname == $ fieldname) {
$ value = get_metadata (& # 39; post & #;; $ post-> ID, & # 39; ct _ & # 39;. $ fieldname, true);
}
}
Return value $ value;
}

Function ca_custom_admin_head () {
$ members_fields = ca_members_fields ();
foreach ($ Members_fields as $ fieldname => $ Members_field) {
add_filter (& # 39; _wp_post_revision_field_ & # 39;. & lt; ct_ & # 39; $ field name, & # 39; ca_field & # 39 ;, 10, 4);
}
}
add_action (# admin_head #, ca_custom_admin_head #);

add_action (& # 39; save_post & # 39 ;, & ca39; ca_save_member_revision & # 39 ;, 10, 2);
Function ca_save_member_revision ($ post_id, $ post) {
if ($ parent_id = wp_is_post_revision ($ post_id)) {
$ parent = get_post ($ parent_id);
if ($ parent-> post_type = & 39; book & # 39;) {
$ members_fields = ca_members_fields ();
foreach ($ Members_fields as $ fieldname => $ Members_field) {
$ meta = get_post_meta ($ parent-> ID, & # 39; ct _ & # 39; $ fieldname, true);
if (false! == $ meta) {
add_metadata (& # 39; post & # 39 ;, post_id, & # 39; ct_ & # 39;. $ field_name, $ meta);
}
}
}
}
}

add_action (& # 39; wp_restore_post_revision & # 39 ;, & # 39; ca_restore_revision & # 39; 10, 2);
Function ca_restore_revision ($ post_id, $ revision_id) {
$ post = get_post ($ post_id);
$ revision = get_post ($ revision_id);
if ($ post-> post_type = & 39; book & # 39;) {
$ members_fields = ca_members_fields ();
foreach ($ Members_fields as $ fieldname => $ Members_field) {
$ meta = get_metadata (& # 39; post & # 39 ;, $ revision-> ID, & # 39; ct _ & # 39;. $ fieldname, true);
if (false! == $ meta) {
update_post_meta ($ post_id, & # 39; ct _ & # 39;. $ fieldname, $ meta);
}
}
}
}