Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2006-08-21 13:48:44

xjosie729
Member
From: Framingham, MA
Registered: 2006-07-22
Posts: 39
Website

Re: [archived] mtp_subsections

Thank you SO much. Now it works!


Josie

Offline

#38 2006-08-21 14:02:13

bit
Archived Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Re: [archived] mtp_subsections

bit wrote:

Is it possible that you can have the mtp_section_tree start at the current section? For example, I just set startlevel='?' to do that…

It seems that I misunderstood how this works. If I just set $root to $pretext['s'], that would set the root to the current section right? If that’s the case, the following line of code would do what I’m asking for…

if(isset($s) && $root = "?") $root = $s;

Right?

Last edited by bit (2006-08-21 14:03:16)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

#39 2006-08-21 16:50:10

plummerm
Archived Plugin Author
Registered: 2006-06-19
Posts: 22

Re: [archived] mtp_subsections

Hi everyone,
I’m sorry I haven’t been in contact about this plugin. Thanks to everyone for checking into these problems!! I have a preliminary version with support for directories and I was waiting to finish debugging that.

Bit- the “startlevel” and “endlevel” just show what the menu will display relative to its root. Setting those is not the answer for what you want to do. Instead, you can set the root (tag attribute root) to the current section ($pretext[‘s’]). If course, you can’t pass a variable like that into a normal textpattern tag, but you can break the tag into a php function with the attributes elements in an array.

it is like this, i’m out of town and don’t have the code in front of me, so be sure to check the actual name of the tag and attributes with the plugin help(!):
<pre>
<txp:php>
echo mtp_section_tree( array(
‘root’ => $pretext[‘s’],
‘startlevel’ => 1,
‘endlevel’ => 2,
));
</txp:php>
</pre>
and of course that php code would be wrapped in a txp:php tag.

Last edited by plummerm (2006-08-21 16:51:23)

Offline

#40 2006-08-21 16:54:11

plummerm
Archived Plugin Author
Registered: 2006-06-19
Posts: 22

Re: [archived] mtp_subsections

redbot-
it is absolutely possible. I did that the “easy” way on my TXP by replacing the stock textpattern section_list function with the section list function that is already in the plugin. However, this is a hack, so I didn’t include it with the plugin. If you want to know more, I can tell you in a few days when i have better computer access.

Offline

#41 2006-08-21 16:58:35

plummerm
Archived Plugin Author
Registered: 2006-06-19
Posts: 22

Re: [archived] mtp_subsections

Oh, and about the lft and rgt- those are not really important for users… I copied it from the category/subcategory code. That is just a nice way of storing how the sections/subsections are built so that the tree is displayed faster.

Offline

#42 2006-08-21 19:25:56

bit
Archived Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Re: [archived] mtp_subsections

Well, it seems that I got it right with if(isset($s) && $root == "?") $root = $s; then. :-P

Actually, it should be more like:
<code>
if($root = ‘?’) {
$root = isset($s) ? $s : ‘Default’;
}
</code>

For the adventurous, this snippet is inserted right after extract($pretext); in the mtp_section_tree function. Setting the attribute, root, to ‘?’ will make the current section the root of the tree. It also gives the nice safeguard of only doing that when a current section is actually set. (Or is this even necessary? Is ‘Default’ the current section in TxP when no section is selected?)

Thanks for the great plugin!

Last edited by bit (2006-08-21 19:26:55)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

#43 2006-08-21 19:44:56

plummerm
Archived Plugin Author
Registered: 2006-06-19
Posts: 22

Re: [archived] mtp_subsections

Hi Bit,
Yeah, that’s a nice method if you don’t mind diving into the code. I may incorporate it or something similar in the next release.

Offline

#44 2006-08-22 01:11:07

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: [archived] mtp_subsections

plummerm wrote:

redbot-
it is absolutely possible. I did that the “easy” way on my TXP by replacing the stock textpattern section_list function with the section list function that is already in the plugin. However, this is a hack, so I didn’t include it with the plugin. If you want to know more, I can tell you in a few days when i have better computer access.

Thank you for your answer plummerm. So I suppose this is not doable with the plugin, which is what I was hoping for. Anyway I’m still interested, even if I have to hack some txp code (I always try to avoid it) because i’m still convinced this would be a very useful feature.
When you have the possibility I’ll be happy to learn more, thanks again.

Offline

#45 2006-08-24 09:19:02

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [archived] mtp_subsections

first of all, thanks for your work. appreciated!
are you working on a clean url scheme to reach the content in the subsections? like /sectionparent/sectionchildren etc?
that would be awesome!

Offline

#46 2006-08-31 09:20:02

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [archived] mtp_subsections

This is an awesome plugin with a lot of potential. Great job! It works just fine on my TXP install

+1 more request for clean URL scheme

(sorry had to slip that in there) :)

Offline

#47 2006-09-18 04:54:22

rawtext
Member
From: Massachusetts, USA
Registered: 2006-09-13
Posts: 21

Re: [archived] mtp_subsections

So this plugin gives you subsection but you can’t reach them like /parent/sub ? only /sub ?

I got it installed and it seems to work, although I don’t see the sub section in the output list I created.

Offline

#48 2006-10-01 09:23:51

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: [archived] mtp_subsections

Hello Matt,
Just two questions:
1) will the plugin be compatible with txp 4.04?
2) Do you plan to release a new version?
I know I’m getting annoying but I’m already using this plugin on a site and I can’t wait to see a new version with new features (section/subsection url etc.). This plugin would definitively change the way I (and many others I think) build TxP sites.
Untill now I used to rely on a section/categoriy scheme for simulating subsections though I never liked it because – in my opinion – categories were not intended for this and furthermore they sometimes allow less experienced user to mess things up (i.e. assigning an article to a section and to a ‘wrong’ category).
…I hope not to be too much insistent with this request.

Regards and thanks again

Offline

Board footer

Powered by FluxBB