• Resolved willlopes

    (@willlopes)


    Hi,

    And thanks for the great work on the plugin. It has been fantastic to work with. I am new to all of these so apologies for the newbie question. I am trying to pull some values from a single field and create HREF with them. I saw your example with using wrapper with multiple images and I am wondering if it is possible to do so with URLs. For example:

    [apr field="Features|Name" glue='<br>' wrapper='<a href='/category/%s' class="btn btn-information" role="button">%s</a> />']

    I have been able to do this with a a field that has a sing value such as:

    <a href='/category/[apr field="Category|Name"]' class="btn btn-information" role="button">[apr field="Category|Name"]</a>

    But can’t seem to be able to do so for multiple variables.

    Can anyone help with this? Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    I think you’re wanting to use the apr_loop:

    
    [apr_loop field="Features"]
    <a href="/category/{{Name}}">{{Name}}</a> OR
    <a href="/category/[apr field='Name']">[apr field='Name']</a>
    [/apr_loop]
    

    And if this is already in a loop, you can use up to 10 nested loops like:

    
    [apr_populate field="Features" relatedTo="Features"]
    
    This is a page with a list of items. Let's list those items!
    
    [apr_loop]
    
    This is a record with some related items in the 'Features' field. Let's loop those features!
    
      [apr_loop1 field="Features"]
        <a href="/category/{{Name}}">{{Name}}</a> OR
        <a href="/category/[apr field='Name']">[apr field='Name']</a>
      [/apr_loop1]
    
    [/apr_loop]
    

    Let me know!

Viewing 1 replies (of 1 total)
  • The topic ‘Creating HREF from multiple field values’ is closed to new replies.