Posts by Byron Fitzgerald

    You should be able to use an array of collections as the key.


    Code
    1. perch_collection([
    2.         'Blog',
    3.         'Case Studies',
    4.         'Publications',
    5.         ''Resources'
    6.     ], [
    7.     'template' => 'blog-template.html',
    8.     'category' => perch_get('cat'),
    9. ]);

    Although this might not work with MySQL 5.7 as standard, due to strict mode, though you should be able to update the settings as required

    Easiest option would be to set up some tags for verified and un verified. If the user is unverified redirect them to a regular perch form, (you can prefill in any info in hidden fields) and then a user can upload a file that way. Once received you can update the tags manually.

    I believe the clean up occurs on save of a region/collection, so I can only guess that without it being saved in a region it won't be subject to the same clean up rules.


    You could always use a collection or a multiple item region to add the files, and then provide a url from there. Otherwise I think you'll have to manually remove the assets

    It might be that the asset is still be used by previous revisions of the content region (for the undo functionality). Once the asset is no longer used by the revisions, the asset should be available for cleanup. You can alter this by adding this to your perch config, define(PERCH_UNDO_BUFFER, 'Value') where the value is the total revisions (defaults to 30). I don't think this will retro actively delete revisions however.

    The select_field allows for, multiple inputs, below is an example

    Code
    1. $class = 'input-simple categories ' . $this->Tag->size('xxl');
    2. $multiple = true;
    3. $Form->select($input_id, $opts, $value, $class, $multiple, $attributes);

    You could potentially add a category set field to your page attributes template. This should then be accessible through perch navigation function, and then rather than using the subitems tag you can just loop through the categories instead.

    You can have multiple apps for a single form, just set it to the following <perch:form id="subscribe" app="perch_mailchimp perch_forms" double-optin="true" />


    As you have a redirection, you'll need to have perch_mailchimp before perch_forms, or the forms app will redirect before the mailchimp app is called.

    A shared region sounds like what you are looking for. You can declare the region anywhere - like a perch layout in your case .

    Code
    1. perch_content_create('Contact Details', [
    2.     'template' => 'shared/contact',
    3.     'shared' => true
    4. ]);


    Combining this with perch_content_custom you can share the data anywhere on your site, whilst letting you use different templates.

    Code
    1. perch_content_custom('Contact Details', [
    2.     'template' => 'shared/footer',
    3. ]);

    Just wanted to make sure I was giving you the right information, hopefully the below helps


    Each website page will use a page template. These should be found in the pages folder in templates. For you I guess this would be path/to/webiste/cms/templates/pages. In these pages you should see parts which look similar to

    Code
    1. perch_content_create('Article',[
    2. 'template' => 'general/article.html'
    3. ])

    The 'Article' string here represents the region name - which shows up in the CMS admin area. If you don't see this, go into your region you want to add the formatting options to, and click the region options tab. There should be a select option for template. This is what you'll need to look for in the next step


    These templates should be located in path/to/webiste/cms/templates/content. In these templates will be your HTML markup. Perch uses an XML template system to define inputs, so you'll be looking for a tag that looks similar to the following

    Code
    1. <perch:content id="content" type="textarea" label="Content" />

    You should be able to search the labels to find the correct field. You'll need to update this tag to the follow (Keeping your ID and label the same as you currently have)

    Code
    1. <perch:content id="content" type="textarea" html="true" editor="redactor" label="Content" />

    Could you not add a manual redirection in your page file?


    Code
    1. if($campaignSlug = PerchUtil::post('lm_campaign_name_slug')) {
    2.     PerchSystem::redirect($campaignSlug.'/downloads')
    3. }

    and then have lm_campaign_name_slug as as hidden field

    What are the textarea inputs looking like in your template? If your looking to use the WYSIWYG editor it should look similar to below.

    Code
    1. <perch:content id="body" type="textarea" label="Article body" html editor="redactor">

    If that looks good are you getting any JS errors in your console?

    The perch:before and perch:after tags are executed only once, Before the collections are displayed, and after the collections are displayed. As your perch:before tags are executed on the second iteration- as the first is seperated - perch won't recognise the tag. You'll need to move your perch:before tags into the first if block for them to be executed. However as the first if block is always the first item, the perch:before tags are redundant. To keep things consistent you can remove the perch:before and perch:after tags and stick with perch:if


    Code
    1. <perch:if exists="perch_item_first">
    2. <perch:content id="post_title">
    3.     <ul>
    4. <perch:else>
    5. <li><perch:content id="post_title"></li>
    6. </perch:if>
    7. <perch:if exists="perch_item_last">
    8.     </ul>
    9. </perch:if>