Pulling a variable into a link

Home Forums Calendar Products Events Calendar PRO Pulling a variable into a link

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #16278
    Darren
    Participant

    I’m not sure whats happened here as it was working but not now. I have made a child of single.php so I can add a link to a contact form that drops a ref code into the subject field but its broken and I cannot see why.

    I have


    <a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+”>Make an enquiry about this course.

    Any php/tribe wizzards able to spot what’s gone wrong.

    #16279
    Darren
    Participant

    It may be helpful to see the error on a live page – just under the facebook logo you can see Ref C1646 Make an enquiry. The Ref C1646 shouldn’t be part of the visible link.

    http://www.highamhall.com/course/westmorland-quilt/

    #16280
    Darren
    Participant

    ah juts noticed the message board has edited my code. Has this worked?

    <a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+”>Make an enquiry about this course.

    #16281
    Darren
    Participant

    arghhh – cant even paste the code!

    #16285
    Darren
    Participant


    <a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+">Make an enquiry about this course.
    </code

    #16286
    Darren
    Participant


    <a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+">Make an enquiry about this course.

    #16287
    Darren
    Participant

    I give up!

    #16288
    Darren
    Participant

    Maybe this time it will work?

    [sourcecode language=”css”]
    &lt;a href=&quot;http://highamhall.com/contact?1subject=Enquiry+regarding+course+"&gt;Make an enquiry about this course.</a>
    [/sourcecode]

    #16303
    Rob
    Member

    Hey Darren. Sorry about the inconvenience; if using the tag isn't working, would you mind dropping the code into pastie.org (or a related service) and sharing the link with us here? We can definitely take a look and try to help you out from there.

    #16304
    Darren
    Participant

    Thanks Rob at least I can now get the code seen 🙂

    http://pastie.org/3534943

    #16342
    Darren
    Participant

    To make this thread less confused I shall explain my problem again.

    I’m not sure whats happened here as it was working but not now. It coudl be an update as custom field now seems to pull css markup where previously it was only the actual variable in the custom field.

    I have made a child of single.php so I can add a link to a contact form that drops a ref code (custom field) into a subject field of a contact form but its broken and I cannot see why.

    The code is posted here http://pastie.org/3534943

    The page with the error – http://www.highamhall.com/course/westmorland-quilt/ – just under the facebook logo you can see ‘Ref C1646 Make an enquiry’. The Ref C1646 shouldn’t be part of the visible link it should be passed to through the link to the contact form.

    Any ideas what’s happened to break it?

    Thanks

    #16374
    Rob
    Member

    Thanks Darren! I’ve asked Jonah from our dev team to take a look here today and respond accordingly. Stay tuned and thanks for your patience thus far.

    #16389
    Jonah
    Participant

    Hi Darren,

    Using tribe_the_custom_fields() is probably not working for you because this returns a definition list or all custom fields for an event. I think what you want to use is: echo tribe_get_custom_field(‘Label’, $post->ID) or tribe_custom_field(‘Label’, $post->ID) – where “Label” is the label of your custom field.

    Let me know whether or not that works.

    #16404
    Darren
    Participant

    Hi Jonah

    Tried both of those examples and they show the link correctly but doesnt grab the custom field. I’ve set the custom field label to Ref as it is in Additional Fields on the settings page – is that correct?

    #16443
    Darren
    Participant

    Its not showing as a fault any more but the new code isn’t pulling any variable from the custom field. I’ve searched the mySQL db but cant see where it may be so I can only assume I’m using the correct name as I’ve set up in the calendar settings page.

    Any suggestions?

Viewing 15 posts - 1 through 15 (of 21 total)
  • The topic ‘Pulling a variable into a link’ is closed to new replies.