Fieldtype, Module

Developer
Supported

Protected Links

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy

     

You must be logged in to post.

Link Expiration and Showing those links

Support Request

pbrienesse
pbrienesse

Hi,

Just getting this going and when I create a new link there is the “link expiration” field. If I live it blank it fills in today’s date.  I guess this is simple enough to get around by telling the client to just enter 2080 as the year. IS there a way just to have a link not expire?

Also if a link is expired is there a way to not display the associated code. For example I have

{grid_protected-files}
      {if grid_protected
-files:count == "1"}
        
<h2>Associated Files</h2>
        <
ul>
      
{/if}
        
<li><a href="{grid_protected-files:field_protected-file:link}">{grid_protected-files:field_link-text}</a></li>
      
{if grid_protected-files:count == grid_protected-files:total_rows}
        
</ul>
      
{/if}
    {
/grid_protected-files} 

Which if the link is expired creates the li with a href=”“

I tried adding a conditional to check if the link exists before spitting everything else out but then the page throws an error “Something has gone wrong and this URL cannot be processed at this time.”

I tried both

{if grid_protected-files:field_protected-file:link}
        
<li><a href="{grid_protected-files:field_protected-file:link}">{grid_protected-files:field_link-text}</a></li>
        
{/if}

and 

        
{if "{grid_protected-files:field_protected-file:link}" != ""}
        
<li><a href="{grid_protected-files:field_protected-file:link}">{grid_protected-files:field_link-text}</a></li>
        
{/if}