Posts by Byron Fitzgerald

    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>

    Sort of grasping at straws now, but if you got to the PerchShop_Orders.class.php file and look for the create_from_cart function.


    If you could add the following

    Code
    1. PerchUtil::debug(PerchUtil::json_safe_encode($cart_data));
    2. $data = [
    3. 'orderStatus' => 'created',
    4. //... rest of data
    5. 'orderShippingAddress' => $ShippingAddress->id(),
    6. ];
    7. PerchUtil::debug(PerchUtil::json_safe_encode($data));

    This will hopefully output something into the debug that might hint to where things are going wrong

    From looking at the Perch Shop order code the two offending fields seem to be

    Code
    1. 'orderItemsTotal' => $cart_data['total_items'] + $cart_data['total_items_tax'],
    2. 'orderSubtotal' => $cart_data['total_items_with_shipping'] - $cart_data['total_discounts'],

    So it looks like it could be a type coercion error. Can you check your cart for the fields above?