Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1432045

    I’m working on adding the metadata element to a bunch of old blog articles and I’m wondering if it’s possible to set defaults for this element? For example, each time I use it I have to change the default separator from “/” to “|”

    Thanks!

    #1432081

    Hi goldengate415,

    There’s no hook/filter to modify the default separator in Post Metadata, so the only option is to override the Post Metadata element via child theme, then do the following:
    1. Go to wp-content\themes\enfold\config-templatebuilder\avia-shortcodes folder, then copy the post_metadata folder.
    2. Go to the child theme and create a new folder shortcodes then paste the post_metadata folder, and edit post_metadata.php
    3. Find this code (line 630 in the latest version)

    $default = array(
    	'post_selected'			=> '',
    	'seperator'				=> '/',
    	'before_meta_content'	=> '',
    	'after_meta_content'	=> '',
    	'margin'				=> '',
    	'padding'				=> '',
    	'align'					=> 'left',
    	'custom_title'			=> '',
    	'size'					=> '',
    );

    Just change the separator value.
    Hope this helps.

    Best regards,
    Nikko

    #1432155

    Thank you for the response, Nikko!

    Feature request for Gunter: possible one day to make this element (or all elements actually…) remember the last used settings?

    Also the element needs a minor spelling correction… “separator” is spelled “seperator”

    Thanks much and ok to close this thread.

    Best,
    Rob

    #1432255

    Also, I decided it was easier to save templates of the metadata element… each template I saved has a different default setting so I don’t have to keep changing the settings each time I use the element.

    #1432256

    Hi,


    @goldengate415

    Better way would be to use custom elements which are editable – https://kriesi.at/documentation/enfold/custom-element-templates/.

    But I will think about a filter that will allow to change the default settings.

    Best regards,
    Günter

    #1432268

    Günter,
    Great to see your post and thank you! After 7 years using Enfold I had never used the custom element and have been using templates instead… wow, this is great! I will start using them for buttons, etc. Wonderful!

    However in the case of the custom element for post metadata, it appears when customizing on the content tab then gonig to the “edit metadata element” and the first box “Metadata” which says “Select the metadata you want to display, if empty or not available your selection will be skipped. On the regular (non customized element) this opens a dropdown with “add/edit metadata” and a “+” so you can stack the metadata elements like “author” and “publishing date”.

    However with the custom element for post metadata, this same field is just a dropdown without the “+” so it lets you select only one element such as “Last Modified Date” but there is no way to string them together (that I can see) like there is on the original non-custom element.

    Am I doing something wrong?

    Thanks,
    Rob

    #1432274

    Hi,

    Please read chapter https://kriesi.at/documentation/enfold/custom-element-templates/#custom-elements-advanced-options and use

    
    add_theme_support( 'show_advanced_custom_element_options' );
    

    This will enable more options.

    And also further down https://kriesi.at/documentation/enfold/custom-element-templates/#custom-elements-advanced-option-custom-elements-for-subitems

    Best regards,
    Günter

    #1432285

    Thanks Günter!

    #1432396

    Hi,

    You must change the following options:

    Hierarchical Custom Elements: Allow use of hierarchical custom elements
    Custom Elements For Subitems: Individually select subitem custom element templates

    Then you can add the meta elements in custom template and lock them if you like.

    Best regards,
    Günter

    #1432406

    Hi Günter,
    That worked beautifully!!!

    Thank you!!!

    I hope this thread helps others with this. The use of a #customelement in ALB will be a huge time saver for me. I didn’t know it was even an option!

    Best,
    Rob

    #ALB #customelement

    #1432407
    #1432408

    Thank you! Just anotehr reason why I have been loyal to Enfold all these years. The ultimate theme!

    #1432446

    Hi,

    Thank you for the update.

    The Separator/Whitespace element is spelled correctly on our end. Please check the screenshot in the private field. Would you mind providing a screenshot of the text or element?

    Best regards,
    Ismael

    #1432456

    Hi Ismael!
    It’s not the Separator/Whitespace element I’m speaking about, it’s the Post Metadata element. If you open that element you’ll see it spelled “Seperator”

    “Seperator
    Will be used to seperate multiple metadata”

    Let me know if you want a screenshot. You guys are great for caring about this little minor misspelling! The new custom element has saved me hours of work today, thanks again! ;)

    Best
    Rob

    #1432460

    Hi Rob,

    I did already a replace of wrong spelled “Separator” for Enfold 6.0 (coming soon) – but only in UI. Making changes to id’s or class names is too dangerous to break existing sites.
    Thanks for pointing at this.

    And thank you for staying to Enfold.

    Best regards,
    Günter

    #1432505

    Enfold 6.0! Exciting! I can remember being excited about version 4.0!

    Best,
    Rob

    #1432558

    Hi Rob,

    Thank you for the continued support! If you have more questions, please feel free to open another thread.

    Have a nice day.

    Best regards,
    Ismael

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘Metadata element – possible to add default settings?’ is closed to new replies.