Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-26 17:04:36

barrywardrop
New Member
Registered: 2008-01-26
Posts: 4

creating dynamic article links within a single section?

Hi,
I wonder if someone could possibly help me?…
I am new to txp and I am trying to build a section page that amongst other static information it will have two divs with tabbed links. the links for example will have, say option 1, option 2, etc.
some how I want to be able to use these links to pull information from articles when clicked but i don’t want to have to leave the page or section. Is this possible and if so could someone please post up some code, that would help to create the links and the article output for such a thing and if you have time explain a little about how it works?

Thank you all in advance!

Barry

Offline

#2 2008-01-26 18:06:26

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: creating dynamic article links within a single section?

You could simply use jquery or some other js library and Ajax

Then just make blank page for your article and call the content with <txp:permlink />.

Cheers!

Offline

#3 2008-01-26 18:11:05

barrywardrop
New Member
Registered: 2008-01-26
Posts: 4

Re: creating dynamic article links within a single section?

Thank you for your reply, It could be an option but I was wondering if there is a way of doing it with what is available within txp as it stands or maybe with a plugin?
I would like to stay away from using js if possible as I would like the page to degrade and still function the same for all users!

I am very new to txp and still very much in the early stages of learning what it can and can not do!

but thank you for your reply it may be the only option!

Does anyone else know of a way around this please?

Thanks in advance

Barry

Offline

#4 2008-01-26 19:42:12

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: creating dynamic article links within a single section?

um theres no way to do it without js. within txp or otherwise. unless you want to go the frame route which is generally always a bad idea.

Offline

#5 2008-01-26 19:51:16

barrywardrop
New Member
Registered: 2008-01-26
Posts: 4

Re: creating dynamic article links within a single section?

Thanks for your reply, I definitely don’t want to be messing with frames your quite right. I was just curious whether anyone had wanted to do a similar thing and had either found a way around it or written a php plugin to do the job?

Thanks again.

Offline

#6 2008-01-27 08:15:59

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: creating dynamic article links within a single section?

It can’t be done with php without pageload – not without js.

Cheers!

Offline

#7 2008-01-28 18:07:17

barrywardrop
New Member
Registered: 2008-01-26
Posts: 4

Re: creating dynamic article links within a single section?

Hi Gocom,

Thanks for your reply. I don’t mind if the page reloads so long as it doesn’t leave that section. what would be the best way of pulling information into the content area that has tabbed links within a page. each tab is to display information from a different article but I would like to be able to do this on that one section without leaving it. what suggestions do people have that would best suit this scenario?

Thanks

Offline

#8 2008-01-28 22:46:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: creating dynamic article links within a single section?

if you want to go the ajax way see 10 javascript ajax tabs for various approaches.

if you don’t want to go the ajax way, you can preload the articles. Call the articles so that they each occupy a separate div using txp:article or txp:article_custom, if necessary with limit and offset attributes or txp:article_custom and the id attribute for specific fixed articles. Style the divs as tabs and then hide the divs you don’t want to see with css. Use a js-switcher to show and hide between the tabs. Again there are lots of tutorials.

jquery is part of the txp install, so you may want to choose a method that works with that.


TXP Builders – finely-crafted code, design and txp

Offline

#9 2008-01-31 09:31:19

wardrop
New Member
Registered: 2007-06-25
Posts: 1

Re: creating dynamic article links within a single section?

Hi Jakop,
Thanks for your reply it has been very helpfull, I am thinking about giving it a go using JS and CSS to hide the articles that arn’t active this way if the user doesn’t have JS they will still see the articles as a list within that div.

Thank you all for your replys and help! ;)

Offline

Board footer

Powered by FluxBB