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

Setting up Channels/Fields/Logic

How Do I?

Christian Sweatt's avatar
Christian Sweatt
281 posts
about 6 years ago
Christian Sweatt's avatar Christian Sweatt

Hi All,

I’ve got a filtered portfolio project where the user will be able to add images or videos which pop up (like an overlay) without directing to another page. The user can also opt to add text content which then designates that the entry SHOULD direct to another page. This is all based on a class. I am trying to figure out how to configure the backend entry fields and the logic that allows EE to know what the user is doing (ajax-link, video-link, or image-link).

Here’s a sample of the three entry types coded out in HTML. I’ve highlighted the three content types. The image and video aren’t different, because they’re just direct URLs - but the issue I can’t seem to figure out is how to code the entry tag when the end-user wants to direct to another page.

The “ajax-link” class is the one that sends the user to a separate page.

Example

I’m not sure how to set this up with conditionals or on the backend so that the site “knows” what to do based on what class the user has input.

Any help would be so greatly appreciated!!

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
about 6 years ago
Robin Sowell's avatar Robin Sowell

I think this is related to the fluid field post, right?

And I’m thinking I’d do this with a grid and have one of the grid columns by a ‘type’ and the content entry person can choose ajax, image, youtube- or whatever you need.

Then you’ve got that grid field to let you know how to change up the layout.

It’s not all that different from some of the default theme’s example code, where you have a ‘video’ grid with two columns. One column is a select with either ‘youtube’ or ‘vimeo’ and then the code to display looks like

{if blog_video}
    {blog_video}
     {if blog_video:type == 'youtube'}
      <figure class="video">
       <div class="player">
        <iframe width="940" height="529" src="http://www.youtube.com/embed/{blog_video:id}?rel=0&controls=2&color=white&autohide=1" frameborder="0" allowfullscreen></iframe>
       </div>
      </figure>
     {/if}
     {if blog_video:type == 'vimeo'}
      <figure class="video">
       <div class="player">
        <iframe src="//player.vimeo.com/video/{blog_video:id}?color=f0a400" width="940" height="529" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
       </div>
      </figure>
     {/if}
    {/blog_video}
   {/if}
       

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.