Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2004-10-04 23:26:40
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
Sure thing. Actually, my reference to $s was incorrect (as d’oh’d above). What I’d like to do is be able to have the flexibility to place the id on the <code><li></code> ($break) rather than be forced to use it on the anchor tag within the <code><li></code>.
The trouble comes in that the function <code>spc_section_alias_linkencode()</code> is what appends the id to the anchor tag, and that function is what builds the link in <code>spc_section_alias_iterate()</code>.
I’ve considered adding another optional parameter to linkencode(), $appendID, default value = true. Then you’d be able to specify whether or not to append the id to the anchor. But this still feels kludgy. Either way, that doesnt get me around the problem encountered with the way join() takes the whole array into a string. It sort of makes it impossible to iterate thru and add id=”$id” to each separate section’s <code><li></code>.
Any ideas?
Offline
#17 2004-10-07 00:37:26
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
Brand new version with big, big changes. See the changelog for version 0.4 and 0.4.1 for details. This takes care of both of compooter’s requests as well as adding a new feature that I’ve been thinking about for a while: namely you may now redefine section entries as you use them.
Say you’ve got a bunch of sections, you’re iterating them, and you want bold tags to appear around the section you are presently viewing (let’s say it’s named articles). Let’s also say that articles is in group ‘2’, but it could also be in ‘1’ or ‘3’ (see compooter’s post above about this). Do the following:
Copy the current values for articles somewhere else (note that this only copies the current section):
<code>
<txp:spc_section_alias_copy srcgroup=“1,2,3” destgroup=“temp” />
</code>
Change the existing value using the new ‘this’ values (see above):
<code>
<txp:spc_section_alias namethis=”<b>.this.</b>” group=“1,2,3” />
</code>
Do your iterate:
<code>
<txp:spc_section_alias_iterate wraptag=“ul” break=“li” group=“1,2,3” />
</code>
Then, change the value back to the way it was:
<code>
<txp:spc_section_alias_copy srcgroup=“temp” destgroup=“1,2,3” />
</code>
I’m hoping I found all of the bugs. If something doesn’t look right, please post a message here and I’ll look into it.
Last edited by spchampion (2005-08-25 14:42:04)
Offline
#18 2004-10-07 00:49:10
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
{stamp of approval} if you’re already using this plugin, you should definitely check out the updates… adds a whole hell of a lotta flexibility.
thanks, stanton!
Last edited by compooter (2004-10-07 00:50:08)
Offline
#19 2004-10-07 04:47:54
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
My pleasure! Good luck with your site!
Offline
#20 2004-10-07 04:51:16
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
Actually it’s not my personal site, but an internal intranet of sorts. Well, more of an internal guidelines/standards/design/development resource for the company I work for. So far it’s been well-received & wouldn’t have been as easy w/out the section aliasing.
Offline
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
If the following message does not appear, please – someone – let me know how to escape the angle brackets. I copied the post to a word processor and inserted a ‘.’ before each [
Ok, I do not know what happened. I just installed 0.41 and suddenly my alias based navigation menu broke.
This tag:
[txp:output_form form=“Navigation” /]
calls this form (Navigation):
[ div id=“navcontainer”]
[ ul id=“navlist”]
[ li][a href=“http://blogs.domainname.com/index.php”]Home[ /a][ /li]
[ txp:spc_section_alias_iterate form=“NavBar” group=“blogs” /]
[ /ul]
[ /div]
which, in turn, calls this form for iteration (NavBar):
[ li][txp:spc_section_alias_link /]
[ txp:mdn_if_section section=”[txp:spc_section_alias_section /]”]
[ ul id=“subnavlist”]
[ txp:asy_category_list break=“li” /]
[ /ul]
[ /txp:mdn_if_section]
[ /li]
The output I get now is solely from the first form (Navigation) where it is asked to output the first list item (Home). This was working beautifully yesterday when using spc_section_alias v.0.3.
At the same time this broke, my front page also broke. It used to list out the latest 5 articles for each section, grouped by section. I used the tag:
[txp:spc_section_alias_iterate form=‘fpage” group=“blogs” /]
which called the form (fpage) for iteration:
[h3][txp:spc_section_alias_link /]
[txp:spc_section_alias_description /][/h3]
[txp:article_custom form=“default” section=”[txp:spc_section_alias_section /]” limit=“5” sortby=“Posted” sortdir=“desc” listform=“Front” /]
How can I fix this using v.0.41? Why did it break?
Last edited by akb (2004-10-07 20:31:33)
Offline
#22 2004-10-07 21:21:23
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
akb, first of all, let’s you get back to 0.3 where things worked for you. Download it here.
Now, let me see if I can figure this out.
Offline
#23 2004-10-07 21:29:52
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
akb, just for reference, can you post your section_prefix? Also, you can escape the angle brackets by putting ‘<‘pre’>’ ‘<‘code’>’ HTML Here ‘<’/code’>’ ‘<’/pre’>’ in the text box. Leave off the quotes.
Last edited by spchampion (2004-10-07 21:32:41)
Offline
#24 2004-10-07 21:39:36
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
akb, this is just an “I just want to make sure” question, but did you remember to activate the plugin when you upgraded it? Make sure it says ‘Yes’ under Active on the Plugins page. I know I’ve made this mistake more than once, and it describes your symptoms exactly.
Last edited by spchampion (2004-10-07 21:51:58)
Offline
#25 2004-10-07 21:42:58
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
LOL – I’ve done that one before :-P
Offline
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
Argh! It looks like it is not a spc_section_alias issue. Having looked into this further, it appears that none of my installed plugins are working.
As a test, I checked both the changecase plug and the if_section plug. I am not sure of what I did to my install to make this happen. I recall I attempted to install one of the amazon plugs and also ImageMagick. I am trying to remember which amazon plug it was.
Can I simply reinstall the textpattern subdirectory without wiping the rest of my install (like the database) or, even if possible, is the database likely to have a problem, too?
Offline
#27 2004-10-08 14:47:54
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
akb,
I would start over with your plugins. Remove them all and then reinstall them one by one.
Offline
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
Ok. While I am not sure why, my problem where no plugins were working seems to have gone away with the reinstall of the v.3.0 spc_section_alias and the v.1.0 if_section plugins (I subsequently re-edited the if_section plugin using the suggested edits <a href=“http://forum.textpattern.com/viewtopic.php?id=2137#25579”>here</a>).
What is still not working, however, is subsequent calls for spc_section_alias data elsewhere on the page.
Thus, for instance, I have used the data in my vertical navigation bar (Yeah! it works!) using a form. The call to “section_prefix” was in the
<pre><head></pre>
section on the main page rather than in the form. As I said, the navigation area works, so I presume this is not a problem with the data in the section_prefix form.
To test where the problem might be, I put the tags directly in the page rather than in a form accessed from the page. The tags I put in were as follows:
<pre>
<txp:spc_section_alias_name />
<txp:spc_section_alias_name section=”<txp:spc_section_alias_section />” />
<txp:spc_section_alias_section />
</pre>
The output I received back was
<pre>
“ />
</pre>
Then I tried it with a form called SectionTop which reads as follows:
<pre>
<txp:spc_section_alias_name />
<h1><txp:spc_section_alias_section /></h1>
<h4><txp:spc_section_alias_description /></h4>
</pre>
This outputs:
<pre>
<h1></h1>
<h4></h4>
</pre>
A subsequent edit to SectionTop to add a call to “section_prefix” yielded the same result.
Last edited by akb (2004-10-08 15:58:38)
Offline
#29 2004-10-08 16:17:34
- spchampion
- Archived Plugin Author
- Registered: 2004-06-10
- Posts: 62
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
Let’s get some debuging information from your system. To begin, before you make those alias_name calls you listed above, add the following line:
<code>
<?php global $spc_section_alias_hash; print_r($spc_section_alias_hash); ?>
</code>
Reload the page and look for a bunch of PHP gibberish. Cut and paste that and mail it to me.
Also, can you confirm whether or not you are having these problems with BOTH 0.3 and 0.4.1?
Oh, and can you do this somewhere where you are not using if_section? I’m wondering if there’s some weird interaction between the two of them…
Last edited by spchampion (2005-08-25 14:42:44)
Offline
Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.
The output has been emailed. To confirm, however, this is an issue with me on both v.0.4.1 and v.0.3
Also, when I put the plugin tags on the page accompanied by only the php line, above, the only thing generated on the page is the output from the php.
Last edited by akb (2004-10-08 17:15:56)
Offline