We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Logic, modules and embeds within custom Module Tags

Development and Programming

hereward's avatar
hereward
91 posts
17 years ago
hereward's avatar hereward

I have created a custom module which works fine except for the following:

I cannot seem to get embeds working within the tags eg the following does not work:

{exp:cg_industry_data:vddu erec_id="{segment_3}"} 
{embed="search/vehicle-details-dealer-used"}
{/exp:cg_industry_data:vddu}

I have also had trouble applying a conditional to variables which are defined within the tags, eg:

{exp:cg_industry_data:vddu erec_id="{segment_3}"} 
{if {my_custom_variable} == "boo"}
    <div> hello world </div>
{/if}
{/exp:cg_industry_data:vddu}

If someone could point me to some documentation which explains how to make this work I would be very greatful. I have read the material here but it does not seem to cover this topic.

thanks!

       
hereward's avatar
hereward
91 posts
17 years ago
hereward's avatar hereward

Update: I have managed to get the conditional working by using quotes, eg.

"{seller_type}"

but I still cannot get the embed to work when inside the module tags.

{exp:cg_industry_data:vddu erec_id="{segment_3}"} 
   {if "{seller_type}" == "Dealer Used" }
      {embed="search/vehicle-details-dealer-used"}
   {/if}
{/exp:cg_industry_data:vddu}

The embed fails. Not sure why. When run outside of the tags it is fine.

       
TonyNibbles's avatar
TonyNibbles
98 posts
17 years ago
TonyNibbles's avatar TonyNibbles

You could try using ‘parse=”inward”’ on your module tag to reverse the parsing order. eg:

{exp:cg_industry_data:vddu erec_id="{segment_3}" parse="inward"}
   {if "{seller_type}" == "Dealer Used" }
      {embed="search/vehicle-details-dealer-used"}
   {/if}
{/exp:cg_industry_data:vddu}

Not 100% about that but give it a go.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.