Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
How to make a back link to list page the same which came?

 

 


esteban
User

Feb 15, 2010, 11:44 AM

Post #1 of 16 (8157 views)
Shortcut
How to make a back link to list page the same which came? Can't Post

Hi
How to make a back link on article page to list page the same which came? I have few list page, on each list page have links to 2 articles, articles have a back link POWRÓT < [= Back]. I would make a link on article page which will enable me to return to the page from which I came not to the first.

On this site works: http://goo.gl/TXIr

Thanks for any solution.


Chris
Staff


Feb 15, 2010, 4:11 PM

Post #2 of 16 (8154 views)
Shortcut
Re: [esteban] How to make a back link to list page the same which came? [In reply to] Can't Post

Hi esteban,

So the problem is that users might be on page 3 of your list page (which uses pagination,) click a link to a detail page, and you want to provide a link back to page 3 of your list page instead of page 1?

This is a little tricky, but I have a solution for you.

On your list page, change the "_link" code from this:


Code
<a href="<?php echo $record['_link'] ?>">


...to this:


Code
<a href="wydarzenia-art.php?page=<?php echo @$_REQUEST['page'] ? htmlspecialchars($_REQUEST['page']) : 1 ?>&num=<?php echo $record['num'] ?>">


...replacing the code in red with the name of your record variable.

And then change the link in your detail page from:


Code
<a href="wydarzenia-lista.php">


...to this:


Code
<a href="wydarzenia-lista.php?page=<?php echo htmlspecialchars(@$_REQUEST['page']) ?>">


I hope this helps! Please let me know if you have any questions.
Chris


(This post was edited by chris on Feb 16, 2010, 12:03 PM)


esteban
User

Feb 15, 2010, 5:34 PM

Post #3 of 16 (8147 views)
Shortcut
Re: [chris] How to make a back link to list page the same which came? [In reply to] Can't Post

Almost working :-) Look at link: http://goo.gl/2hct
there displays a &num=3"> i don't know how improve code and the link is wrong not to the right article.

You wrote: "...replacing the code in red with the name of your record variable. " I do not know how to do it. What is this record variable in my case?

Thanks Chris


Chris
Staff


Feb 16, 2010, 12:06 PM

Post #4 of 16 (8141 views)
Shortcut
Re: [esteban] How to make a back link to list page the same which came? [In reply to] Can't Post

Hi esteban,

Sorry, my fault. I had an extra "> in the code. I've edited my post above to remove it. Please remove the code in red below from your wydarzenia-lista.php page:


Code
<a href="wydarzenia-art.php?page=<?php echo @$_REQUEST['page'] ? htmlspecialchars($_REQUEST['page']) : 1 ?>">&num=<?php echo $record['num'] ?>">



In Reply To
What is this record variable in my case?


It must be already correct since the code is working.

Please let me know if you have any questions.
Chris


esteban
User

Feb 16, 2010, 12:29 PM

Post #5 of 16 (8139 views)
Shortcut
Re: [chris] How to make a back link to list page the same which came? [In reply to] Can't Post

Yes! It's works perfectly. Thanks :-)


pod9
User

May 21, 2010, 4:56 AM

Post #6 of 16 (7520 views)
Shortcut
Re: [esteban] How to make a back link to list page the same which came? [In reply to] Can't Post

I'm trying to achiev the same thing but am confused by "wydarzenia-lista.php". Is this something specific to esteban?

Can you give me the generic way to solve this problem?


jarvis
User

May 21, 2010, 7:19 AM

Post #7 of 16 (7515 views)
Shortcut
Re: [pod9] How to make a back link to list page the same which came? [In reply to] Can't Post

Can you not use a PHP referrer. So:

Code
<?php 
$ref=@$HTTP_REFERER;

echo '<a href="$ref "> <<back </a>'; ?>

Does that help?


pod9
User

May 24, 2010, 2:29 AM

Post #8 of 16 (7487 views)
Shortcut
Re: [jarvis] How to make a back link to list page the same which came? [In reply to] Can't Post

Does that not assume that they have always come from the news listing page? Sometimes they may have come from a third party link such as a search engine.


jarvis
User

May 24, 2010, 2:31 AM

Post #9 of 16 (7486 views)
Shortcut
Re: [pod9] How to make a back link to list page the same which came? [In reply to] Can't Post

It will always go back to the exact previous page, i.e:

- link from Google
- Page 8 0f 15 (for example) of your listings page

Does that help? Best bet is to try it & see if it does what you're after!

Cheers


pod9
User

May 24, 2010, 6:43 AM

Post #10 of 16 (7480 views)
Shortcut
Re: [jarvis] How to make a back link to list page the same which came? [In reply to] Can't Post

no, I want it to go back to the listing page that had the article introduction on it.


jarvis
User

May 24, 2010, 6:45 AM

Post #11 of 16 (7479 views)
Shortcut
Re: [pod9] How to make a back link to list page the same which came? [In reply to] Can't Post

That code will work just fine for that


Donna
Staff


May 24, 2010, 12:18 PM

Post #12 of 16 (7342 views)
Shortcut
Re: [pod9] How to make a back link to list page the same which came? [In reply to] Can't Post

Hi pod9,

Yes, "wydarzenia-lista.php" was specific to Esteban. For your own page, simply replace that with your own list page filename. :)

Donna

--
support@interactivetools.com


zick
User

Dec 7, 2011, 11:57 PM

Post #13 of 16 (3643 views)
Shortcut
Re: [Chris] How to make a back link to list page the same which came? [In reply to] Can't Post

Exactly what I needed! Thanks Chris!!!!!
Zick


zick
User

Dec 9, 2011, 9:42 AM

Post #14 of 16 (3611 views)
Shortcut
Re: [Chris] How to make a back link to list page the same which came? [In reply to] Can't Post

Chris,
Is it possible to make this a default setting for CMS Builder installations? So that when you generate the code for the page, the back link is already in place and ready to use?


ross
Staff / Moderator


Dec 9, 2011, 4:40 PM

Post #15 of 16 (3607 views)
Shortcut
Re: [zick] How to make a back link to list page the same which came? [In reply to] Can't Post

Hi Zick

I can add it to the list. Not sure when or how that will be implemented, but it's on the list!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



zick
User

Dec 9, 2011, 10:52 PM

Post #16 of 16 (3596 views)
Shortcut
Re: [Chris] How to make a back link to list page the same which came? [In reply to] Can't Post


In Reply To
Hi esteban,

Sorry, my fault. I had an extra "> in the code. I've edited my post above to remove it. Please remove the code in red below from your wydarzenia-lista.php page:


Code
<a href="wydarzenia-art.php?page=<?php echo @$_REQUEST['page'] ? htmlspecialchars($_REQUEST['page']) : 1 ?>">&num=<?php echo $record['num'] ?>">



In Reply To
What is this record variable in my case?


It must be already correct since the code is working.

Please let me know if you have any questions.



Hey Chris,
I ran this through W3C validation and it was producing errors, so I made a slight change and it passed validation. Below in red is the change I made:


Code
<a href="wydarzenia-art.php?page=<?php echo @$_REQUEST['page'] ? htmlspecialchars($_REQUEST['page']) : 1 ?>&amp;num=<?php echo $record['num'] ?>">