Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

How to? Include conditional content on Static page

Quote Reply
How to? Include conditional content on Static page
Hi,

I want to display certain types of content if the user is logged in & other content if the user is not logged in.

However, I want to do this while doing a 'static build' for the website.

I am trying below method & it does not seem to work completely.

1. page extension is .php
note: I am able to use other php codes and tags on this page.

2. Then I include below code at desired location on page:
<?php include "https://domain.com/a/cgi/page.cgi?p=dynamic-test"; ?>


Inside dynamic.html I have the following code:

Code:
<%if Usernamer%>
Hello <%Username%> : How are you ?
<%else%> User is not Logged in.
<%endif%>

However it does not work.

I thought that every time the page is viewed (called by the browser), it would trigger php include function & content of dynamic.html page would be displayed based on the condition if the user is logged in or not.

Any idea on how to make this work using php include function?

------------------------------------------

Btw.. I have tested above using iframe & it works as desired, however, I am trying to avoid iframe & use PHP.

Vishal
-------------------------------------------------------
Subject Author Views Date
Thread How to? Include conditional content on Static page VishalT 3664 Mar 6, 2021, 8:05 AM
Thread Re: [VishalT] How to? Include conditional content on Static page
VishalT 3630 Mar 6, 2021, 8:38 AM
Thread Re: [VishalT] How to? Include conditional content on Static page
VishalT 3604 Mar 6, 2021, 10:12 AM
Thread Re: [VishalT] How to? Include conditional content on Static page
el noe 3602 Mar 6, 2021, 4:57 PM
Thread Re: [el noe] How to? Include conditional content on Static page
VishalT 3588 Mar 7, 2021, 1:35 AM
Thread Re: [VishalT] How to? Include conditional content on Static page
el noe 3576 Mar 7, 2021, 8:26 AM
Thread Re: [el noe] How to? Include conditional content on Static page
VishalT 3568 Mar 7, 2021, 11:22 AM
Thread Re: [VishalT] How to? Include conditional content on Static page
el noe 3557 Mar 8, 2021, 12:10 AM
Thread Re: [el noe] How to? Include conditional content on Static page
Andy 3534 Mar 8, 2021, 7:06 AM
Post Re: [Andy] How to? Include conditional content on Static page
VishalT 3485 Mar 9, 2021, 2:27 PM
Post Re: [el noe] How to? Include conditional content on Static page
VishalT 3488 Mar 9, 2021, 2:26 PM