Posts by hus_hmd

    But, I'm not sure how to change the order of the dates in perch:repeater id="event_dates", ideally it needs to be in reverse chronological order so the next upcoming date is shown, not just the first date in the array.


    You perhaps can reorder the array with usort(). Assuming your date field inside the repeater has the ID date:


    Is there a way to access the IDs inside perch:related id="feat_event"? using perch_content_custom :/

    In PHP, you need to fetch the item with perch_collection(). perch:related does this for you inside the template. If you skip the templating, you need to do this yourself:


    The urlify attribute in a template only affects the output. It does not affect how the data is saved. So you should be able to use Energy & Utilities:


    PHP
    1. perch_blog_custom([
    2. 'sort' => 'postDateTime',
    3. 'template' => 'blog/post_in_column.html',
    4. 'sort-order' => 'DESC',
    5. 'filter' => 'industry',
    6. 'match'=> 'eq',
    7. 'value'=> 'Energy & Utilities',
    8. ]);


    This has nothing to do with dashes. Using dashes for field IDs is not advised (https://docs.grabaperch.com/templates/attributes/id/), but that's a completely different thing.

    Ideally you'd have 2 different category fields if you need the separation:


    HTML
    1. <perch:categories id="categories" set="blog" label="Categories" />
    2. <perch:categories id="tags" set="tags" label="Tags" />


    However, the category option in perch_blog_custom() only works for the Category Set blog. So you cannot filter by tags like so:


    PHP
    1. perch_blog_custom([
    2. 'category' => 'tags/test/'
    3. ]);


    Fortunately, you can use a normal filter instead:


    PHP
    1. perch_blog_custom([
    2. 'filter' => '_category',
    3. 'value' => 'tags/test/',
    4. ]);



    If you want to read more about category filtering: https://grabapipit.com/blog/category-filtering

    Hi Stephen,


    You can use PerchSystem::set_var() and PerchSystem::get_var():


    PHP
    1. // inside layout
    2. PerchSystem::set_var('my_variable', 'some value');


    PHP
    1. perch_layout('head');
    2. $my_variable = PerchSystem::get_var('my_variable');


    Note that set_var() makes the variable available for the template engine. You can always unset it if you no longer need it:


    PHP
    1. PerchSystem::unset_var('my_variable');

    The is an array with a single element (a string):



    This is an array of strings:


    Hope this helps.

    If you are not opposed to using a third-party service, you can use the Cloudinary template filter. Cloudinary supports resizing animated GIFs.


    Does either of the below return any results? p.s. you can try these anywhere on the page; it does not have to be inside the layout.


    PHP
    1. perch_blog_custom([
    2. 'filter' => 'postURL',
    3. 'value' => '/newsroom/what-telecom-partners-talk-about',
    4. ]);
    5. perch_blog_custom([
    6. 'filter' => 'postSlug',
    7. 'value' => 'what-telecom-partners-talk-about',
    8. ]);