Plugin

Archived
Forum
(read-only)

String

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From eMarketSouth

     

Random parameter and caching

Support Request

JulieP
JulieP

I’m using String for the first time and hoping it’ll work for me. I have a magazine split into editions, each with N number of book reviews. Each book review belongs to an edition via a playa field. On the book reviews page, we want to list each book review grouped by edition, with the edition heading at the top (only if there are book reviews for that edition). Here’s my code:

{exp:weblog:entries weblog="editions"}
 {exp
:string:set name="parent_title" random}{title}{/exp:string:set}
    {reverse_related_entries weblog
="book-reviews"}
        {if 
"{count}"=="1"}<div class="book-review-edition"><p>{exp:string name="parent_title"}</p></div>{/if}
            [
...]
    {
/reverse_related_entries}
  {exp
:string:clear name="parent_title"}
{
/exp:weblog:entries} 

This is working PERFECTLY, except that the {exp:string name=“parent_title”} does not clear and does not change. It only spits out the first parent title. Ideas?

JulieP
# 1
JulieP

ack. got it. I had the random in the wrong tag…

{if "{count}"=="1"}<div class="book-review-edition"><p>{exp:string name="parent_title" random}</p></div>{/if} 

instead of

{exp:string:set name="parent_title" random}{title}{/exp:string:set} 
jonas122
# 2
jonas122

These are some easy ways to merge custom field with Mailchimp and it will help you to pass data without any loss. Some of online writing service work 24 hours and you can easily buy assignment online for your academic tasks.