Tagged: , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #424512

    Hello,

    First of all – thanks again for Enfold which is by far the best theme I’ve been using to this day.

    I have a site with a significant number of pages and portfolio entries. Each is about a particular service. On each page/portoflio entry, the same sidebar is displayed that contains a call to action button (“Request more Information”). The CTA button links to a contact form.

    Challenge
    Once the user clicks the CTA button on a page, opens the contact form and fills out the form, we receive the form entry by email – but we are not able to see from what page the user navigated to the contact form.

    Approach
    We’ve introduced a custom field “product” on each page / post. The value of “product” is a product identifier we want to include in the form submission and is manually set when creating the page/post. I’ve also created a shortcode [getProduct] in functions.php that returns the value of “product”. This is tested and works successfully. We would like to include this value as a URL parameter when opening the contact form.

    Example:
    getProduct value = awesomeService
    Button Shortcode:[av_button label='Request more Information' link='manually,./contact-form/?service=[getProduct]' link_target='' size='large' position='center' icon_select='no' font='entypo-fontello' color='orange' custom_bg='#444444' custom_font='#ffffff']

    The button should point to the URL ./contact-form/?service=awesomeService

    Problem
    When including the Shortcode [getProduct] (or any other Shortcode, for that matter) in any Avia-Element such as Button, the functionality breaks. It looks like the nested shortcode’s closing square bracket is interpreted by the theme as closing square bracked for the entire Avia-Element. The button isn’t correctly displayed and the link doesn’t work.
    See here for a screenshot:
    http://cl.ly/image/0j1s1T0s1d0y

    Is there any way to fix this or can you propose a workaround that saves us from manually placing buttons on each page/post?

    Thanks and kind regards
    Jason

    • This topic was modified 9 years, 7 months ago by Jason.
    #424860

    Hey Jason!

    This customization is going to take a lot of time and code to implement. It would be best to hire a freelancer to help you out with this. Or you might be able to find a way to do this in a contact form plugin such as gravity forms or contact form 7.

    Regards,
    Elliott

    #424864

    Hi Elliott,

    thanks for the quick reply. Populating the form value over the parameter as URL and prepopulating the form is not the issue (I am using GravityForms at the moment).

    The issue is to create a URL that involves a shortcode and apply this URL to the enfold button.

    Let’s look at this example:
    Inside a post body:
    If I create a href called http://someurl/?someParam=[someShortcode]this works perfectly and the [someShortcode] piece is resolved when the page is rendered, leading to an URL like http://someurl/?someParam=1234
    Inside the Avia Button Shortcode:
    If I use the same URL inside an Avia Button, it doesn’t work as the [someShortcode] part doesn’t get properly resolved, and breaks the button instead. See my screenshot above.

    In my opinion this is not a question of customization but rather a limitation of how Enfold seems to parse Shortcodes placed inside Theme-Shortcodes…?

    Thanks again for your support
    Jason

    • This reply was modified 9 years, 7 months ago by Jason.
    #425676

    Hey!

    Enfold is not made for what you want to do. I suggest to use a tracking plugin instead. I personally recommend jetpack, but go here and research for yourself: http://crunchify.com/top-5-best-tracking-plugins-for-your-wordpress-blog/

    Best regards,
    Andy

    #425735

    Hi Andy,

    thanks for your reply. I’m not sure I described the problem correctly.
    My issue is around the fact that any shortcode inside the avia button will break the button. The case with the ‘tracking’ was just an example. We use tracking on our site and it doesn’t solve the challenge we face.

    I have created another ticket here https://kriesi.at/support/topic/shortcodes-inside-avia-elements/ with a screenshot and link to the site where the problem occurs.

    Thanks again for your help.

    Kind regards
    Jason

    #426174

    Hi!

    I replied to your other thread. Please do not double post.

    Regards,
    Elliott

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Shortcodes inside Avia-Elements (e.g. as URL Parameter)’ is closed to new replies.