Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-08 01:01:55

veronica
New Member
Registered: 2008-09-08
Posts: 7

linking from parent to parent article and from parent to child

Hello,

I’m fairly new to textpattern and have a website which has a number of parent-level articles which need to allow:

(i) the user to go from one parent to the next (by-passing the children of any parent) and also

(ii) to have links from each parent to each of five of its children (by category assignment). Then

(iii) the fifth of those children will be the first of many children in that category and I need navigation to allow for choosing another child by specific link and by next/previous linkage.

I’ve been searching for tutorials to help with this but am not finding what I need.

And help, pointers, would be appreciated.

Thanks,

Veronica

Offline

#2 2008-09-08 16:30:35

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: linking from parent to parent article and from parent to child

Usually you can do lots of things with custom fields/keywords/categories, but I must say I don’t really understand your structure. Could you visualize it maybe?

Offline

#3 2008-09-09 04:14:07

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: linking from parent to parent article and from parent to child

veronica wrote:

Hello, I’m fairly new to textpattern and have a website which has a number of parent-level articles …

I’m not sure about the “linking articles” bit. Articles can be assigned to categories or have keywords/custom fields added to them but ultimately they belong to sections. It’s the sections that can be linked together in a parent-child relationship. There’s a couple of plugins to do this: adi_menu (one of mine) or cnk_section_tree.

Categories can be assigned to “parents” in TXP admin but I think you need a plugin to exploit this (?).

Offline

#4 2008-09-14 08:55:53

veronica
New Member
Registered: 2008-09-08
Posts: 7

Re: linking from parent to parent article and from parent to child

Hello Els,

Thanks for responding – I’m sorry to be slow replying; I’d imagined I might get an email if there were any replies and I failed to check back in after a bit.

With help from a friend, I’ve managed to get the links from the list going to each of the “parent” docs with this:

<ul class=“artistList”>
<txp:article_custom level=“parent” category2=“artist-homepage” sortby=“title” sortdir=“asc” limit=“99”>
<li><txp:permlink><txp:title /></txp:permlink></li>
</txp:article_custom>
</ul>

But that’s as far as I’ve got.

Once we’re on the artist’s homepage, I need to be able to link to four child pages via text links (biography, statement, contact, news) and five child pages via thumbnails (from the five most recently-posted “artwork” articles). Each kind of page can be accessed via its category2 (artwork,biography,contact,news,statement).

The site is a gallery site and each artist gets their homepage with nine subpages.

Does this clarify it?

Many thanks!

Offline

#5 2008-09-14 21:44:32

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: linking from parent to parent article and from parent to child

I understand you have a custom field named ‘level’, for the artist home page it has value ‘parent’, and for the other articles it has value ‘child’ I assume?

Seeing your code, you must be running the not-yet-released 4.0.7 :) No problem, that should only make things easier. But I didn’t think there was an attribute category2?

It would be best if you’re using sections for the artists. So all parent and child articles belonging to ‘name of artist 1’ are in a section named ‘name-of-artist-1’. Are you already doing this?

BTW, to receive email notifications you have to subscribe to a topic, see the link at the bottom left of each topic.

Offline

#6 2008-09-15 06:50:26

veronica
New Member
Registered: 2008-09-08
Posts: 7

Re: linking from parent to parent article and from parent to child

Hello Els,

Thanks again. Am I running version 4.0.7? I’m not sure. I have an installation that includes a lot of customized features that a friend of mine did. He has been ill, so I thought I’d try and figure out the issues by writing to this forum. However, I’m guessing I’d better wait until he’s better. I don’t have a custom field named level; this just works in his installation.

What I do have is a section named artists. category1 is for current member, former member, guest artist; category2 is for the various kinds of pages each artist has (home page, artwork, biography, contact, news and statement). But the default installation doesn’t have category2…? OK. I’ll wait for him to get better.

But thanks!!

Offline

#7 2008-09-15 06:55:42

veronica
New Member
Registered: 2008-09-08
Posts: 7

Re: linking from parent to parent article and from parent to child

And thank you Gomedia. I think I understand your reply better than I did now. It looks as if my installation is too different from the default version for my problem to make sense here. I can very definitely make families within sections (and have).

So I’d better wait for my friend…

All best,

Veronica

Offline

#8 2008-09-15 07:21:54

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

Re: linking from parent to parent article and from parent to child

veronica wrote:

And thank you Gomedia. I think I understand your reply better than I did now. It looks as if my installation is too different from the default version for my problem to make sense here. I can very definitely make families within sections (and have).

So I’d better wait for my friend…

Yeah, wait from if you two have moded or hacked Textpattern’s core.

Btw, an one big advice; Never hack the core, instead write and code plugins to extend Textpattern’s functionalities. It makes everything more better and simplier; including updating, security and support.

And other advice coming up too; including that your using a hacked version, but also you are using a non stable subversion. And as we know, non official (non) stable releases should almost never be used in live production.

Last edited by Gocom (2008-09-15 07:27:00)

Offline

#9 2008-09-15 09:58:14

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: linking from parent to parent article and from parent to child

Hi Veronica, sorry we can’t help you, but if your TXP install is indeed customized there is no way for us to know how it is supposed to work. Hope your friend will get better soon!

Offline

#10 2008-09-16 08:30:32

veronica
New Member
Registered: 2008-09-08
Posts: 7

Re: linking from parent to parent article and from parent to child

Hello Els and Gocom,

Thanks again. Friend recovered enough to get this working, so all’s good. Curious about the warnings against non-plugin customizations, though. What my friend does is make all his modifications via one file (publish_mod.php) such that it works with any installation of the out-of-the-box textpattern latest version. I can see it’s potentially problematic for me when he’s down for the count, but would this be less stable than using plugins? I would have thought it would be very similar.

Thanks!

Veronica

Offline

#11 2008-09-16 09:48:53

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

Re: linking from parent to parent article and from parent to child

veronica wrote:

What my friend does is make all his modifications via one file (publish_mod.php) such that it works with any installation of the out-of-the-box textpattern latest version.

Hi veronica,

it still is modified ‘cause PHP doesn’t support function rewriting, redifining nor overwriting (stannardly, but doable by module) – there can’t be two same functions. And if you update, you have to remember to include that modified file again instead of the stannard publish.php. With function rewriting you could overwrite the functions (via plugin), but better would be make new ones inside a plugin.

If those functions are inside of plugin, then you don’t need to update any files manually after updating your Textpattern installation.

In example you have a plugin that causes some harm, opens security hole ‘cause it doesn’t escape data that is inserted or requested from database. When the it is plugin, you can just turn it off and the problem goes away instantly, but when it is hack in the core, then it is harder to fix.

I can see it’s potentially problematic for me when he’s down for the count, but would this be less stable than using plugins?

Not less stable if the code is valid, secure, fast, and good, but problems come with updating and maintaining it.

Offline

#12 2008-09-16 10:13:14

veronica
New Member
Registered: 2008-09-08
Posts: 7

Re: linking from parent to parent article and from parent to child

OK, thanks Gocom.

What he does, by the way, is comment out functions in publish.php if he writes a new version of them in publish_mod.php (plus writes new functions). Seems very clean and well-organized and I’m pretty sure the code is “valid, secure, fast, and good” — but I take your point.

Veronica

Offline

Board footer

Powered by FluxBB