WordPress.org

Forums

Events Manager
[resolved] Need Help Understanding How to Hide a Custom Attribute (5 posts)

  1. theumbrellaagency
    Member
    Posted 1 year ago #

    Hello all - I have successfully been able to follow instructions provided in the documentation for adding custom attributes to a new event form but need to be able to add a conditional placeholder to three of my custom attributes.

    I have created the following custom attributes and added them to the events attribute box here Events > Settings > General > Pages:

    #_ATT{Open To The Public?}{Yes|No|}
    #_ATT{Coordinator Name}
    #_ATT{Phone}
    #_ATT{Email}

    I've tried to add the following code to the 'Default Single Event' here: Events > Settings > Formatting > Default Single Event Box

    <div style="float:right; margin:0px 0px 15px 15px;">#_LOCATIONMAP</div>
    <p>
    	<strong>Date/Time</strong><br/>
    	Date(s) - #_EVENTDATES<br /><i>#_EVENTTIMES</i>
    </p>
    {has_location}
    <p>
    	<strong>Location</strong><br/>
    	#_LOCATIONLINK
    </p>
    {/has_location}
    <p>
    <strong>Event Details</strong><br />
    Open To The Public - #_ATT{Open To The Public?}{Yes|No|}<br />
    {has_coordinator_name}
    Coordinator Name - #_ATT{Coordinator Name}<br />
    {/has_coordinator_name}
    {has_phone}Phone - #_ATT{Phone}<br />
    {/has_phone}
    {has_email}
    Email - #_ATT{Email}<br />
    {/has_email}
    </p>
    <p>
    	<strong>Categories</strong>
    	#_CATEGORIES
    </p>
    <br style="clear:both" />
    #_EVENTNOTES
    {has_bookings}
    <h3>Bookings</h3>
    #_BOOKINGFORM
    {/has_bookings}

    It is hiding the custom attribute fields I created. Am I formatting the html incorrectly, do I need to add some php somewhere, or all of the above?

    Thank you.

    http://wordpress.org/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    the conditional placeholders you're wrapping them around (e.g. {has_coordinator_name}) don't exist.

    if you've tried to create these using PHP, maybe that's the problem and they're not showing due to that.

  3. theumbrellaagency
    Member
    Posted 1 year ago #

    Hi Marcus,

    I have not tried to create those using PHP. Are you familiar with creating new conditional placeholders?

    I did find this tutorial and tried to add the code to my template to see if it works via the mu-plugin option but it keeps bringing up errors.

    I don't need to create 'Style' specific pages, only create the placeholders.

    Would you mind taking a quick look to see what steps I need to complete in order to create the conditional placeholders I need to use?

    The link is below. I'm confused after 45 minutes of tinkering around.

    http://wp-events-plugin.com/tutorials/creating-a-events-manager-add-on-a-complete-walkthrough/

  4. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    What do the errors you mentioned say?

  5. theumbrellaagency
    Member
    Posted 1 year ago #

    Morning, Caimin_nwl. I decided to employ the alternate text option to my custom attribute instead of tackle understanding/teaching myself how to make this PHP work at this time. It was the simplest solution and helps maintain the layout of the page, spatially.

    In the general options:
    #_ATT{Email}{n/a}

    Events > Settings > Formatting > Default Single Event Box:

    <br style="clear:both" />
    <div>#_LOCATIONMAP</div>
    <br style="clear:both" />
    <p>
    	<strong>Date/Time</strong><br/>
    	Date(s) - #_EVENTDATES<br /><i>#_EVENTTIMES</i>
    </p>
    {has_location}
    <p>
    	<strong>Location</strong><br/>
    	#_LOCATIONLINK
    </p>
    {/has_location}
    <p>
    <strong>Event Details</strong><br />
    Open To The Public - #_ATT{Open To The Public?}{Yes|No|}<br />
    Coordinator Name - #_ATT{Coordinator Name}{ Coordinator Name:  n/a}<br />
    Event Phone:  #_ATT{Event Phone}{n/a}<br />
    Event Email:  #_ATT{Event Email}{n/a}<br />
    Event Registration URL:  #_ATT{Event Registration URL}{n/a}
    </p>
    <p>
    	<strong>Categories</strong>
    	#_CATEGORIES
    </p>
    <br style="clear:both" />
    <h5>Event Description</h5>
    #_EVENTNOTES
    {has_bookings}
    <h5>Bookings</h5>
    #_BOOKINGFORM
    {/has_bookings}

    Thank you both for taking the time to help me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic