Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Return Custom Home

Quote Reply
Return Custom Home
Hi,

THis one is a bit hard to explain but I am going to give it a try...

Lets say that I have 10 home pages, each have a different use. (These are custom pages and not the home.html) These pages are landed on in dynamic mode with a p=blahblah01, p=blahblah02, etc...

Next what I did was to create a dynamic include_menu along with a static version that resides in the same template. This was done with the "if username"/"endif" and was successful.

But I have run into a bit of an issue with the links within the dynamic side of the include_menu. I would like to be able to have the HOME link to take them back to their respective home page based upon the one they started on. For example:

I login and select homepage 2
I go do a search on the search page
now I want to return to homepage 2

How can I do this without using the back button on the browser? I thought about using a script that takes you back X number of places but that will not work as the number of movements will vary.

Any ideas would be appreciated!

Thanks

Brian
Quote Reply
Re: [Teambldr] Return Custom Home In reply to
You need to pass their home page through as a dynamically preserved variable. Maybe add an "h" to the preserved variables page. When a user hits your site, you set this variable, and then in your menu html code you insert the correct page based on the h= value.

For what you want to do, I think this is the only (and simplest) way to do it.

If a user has a "default" home page, that is based on the username/preferences, rather than a referred in (or paid /sponsored) page, you can base the changes in the html on a field in the user record using a global to fetch it.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Return Custom Home In reply to
Thanks pugdog.

That seems to be a good way to do it. One other variable that I did not mention in the last post is that each time that they login they could select a different home page. Sometimes homepage 1, sometimes homepage 6. So whichever one they choose needs to be the active HOME button in the include_menu.

With this in mind does your idea still work or would I have to set some sort of cookie when they land on the homepage of thier choice?

Thanks again!

Brian
Quote Reply
Re: [Teambldr] Return Custom Home In reply to
No, if you don't set h= on the users first visit to your site, it won't be set.

Once they pick a page, that dynamic link should be set to h=1 or h=6, or whatever that selection is. You can add that by adding either a ?h=1 or &h=1 to the end of the link string, depending.

Once h= is set to a non=0 value, it should be preserved throughout the rest of the sesssion.

There *are* some quirks in the system, so if you start to use this extensively, you may need to submit a few bug reports. I believe some were recently submitted on the t= parameter not preserving the default template set into sub categories or something similar.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Return Custom Home In reply to
OK...let me see if I have this right:

The h= setting is for one session only

THe h= would have to be set when selecting the home page with each session

so a link with multiple items in it using this method would be an &h=#

Does that look right?

Thanks again.

Brian
Quote Reply
Re: [Teambldr] Return Custom Home In reply to
I think you have it. But remember, you need to add h to the list of dynamically preserved variables in the Links Admin area.

That choice only affects links they click from that point on, that are dynamically created. If they enter a static area, then go back to your dynamic home page (by redirection) the h= is lost, as it's not part of the default system.

In order to do that, you'd have to create a global, or callable function that sets a user's cookie to that value, and then check that cookie whenever you start to print out the menu. I think that is a bit of overkill for what you want, especially if it's not vital that the user only sees that one home page during his visit.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Return Custom Home In reply to
Hi Pugdog,

OK...I think I have the answer (with your help thank you)

Here is a config of the url:

page.cgi?d=1&p=xxxx&h=xx

I added h to the dynamic_preserve

This will be selected when leaving a login page and will land on homepage xxxx.
Then I am creating a multi-layered if such as:

<%if xx%>
show link to xxxx
<%endif%>
<%if yy%>
show link to yyyy
<%endif%>
<%if zz%>
show link to zzzz
<%endif%>

and so on.

Then this will allow the person to float about the site and if they want to return to their homepage all they would do is press the HOME button and it will take them to their respective homepage.

I think this will work.

Thanks again for the assistance.

Brian

Last edited by:

Teambldr: Jan 30, 2003, 4:38 PM
Quote Reply
Re: [Teambldr] Return Custom Home In reply to
IT WORKSSSSSS!!!!!

I had to format the HOME tag statement a little different though...

<%if h eq 'xx'%>
show the xxxx homepage link
<%elsif h eq 'yy'%>
show the yyyy homepage link
<%elsif h eq 'zz'%>
show the zzzz homepage link
<%else%>
show the static home link
<%endif%>

You have to also make sure that you use the d=1 in the url and as pugdog said, add the h to the dynamic_preserve in setup.

With that a person can log into the system via Community or through the normal channels and the person will always be able to return to your custom homepage.

This is WAY COOL! Thanks again pugdog (and Jack, Alex, Virginia and the rest of the GT staff!) This project is really coming together with your help.

Brian
Quote Reply
Re: [Teambldr] Return Custom Home In reply to
Glad it works :)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.