Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2004-11-18 19:54:55

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Vltruvius,

Add an alias for section=“default” and you’ll have a entry for the home page. Alias it as you see fit. See “Quick Note #1” at the very bottom of my original post.

Last edited by spchampion (2004-11-18 19:55:47)

Offline

#62 2004-11-18 23:54:33

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 125

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Thank you – I knew it would be staring me in the face – and so simple as well…

Can I pop another question:

I would like to have a horizontal section menu seperated with the ‘ | ‘ character.

At the moment I use the <code>break=”&nbsp; | &nbsp;”</code> but that ends up with a ‘ | ‘ at the end of the list:

home | about | portfolio | contactus |

What I really want is:

home | about | portfolio | contactus

Any ideas?

Offline

#63 2004-11-20 23:16:28

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Well… You might be able to hack this up using the description2 field (if you aren’t using it already). Since iterate outputs the elements in the order you add them, simply make description2 = “ | “ for each element except the last one. Then, within your iterate form, do:

<code>
<txp:spc_section_alias_link /><txp:spc_section_alias_description2 />
</code>

Ugly? Yeah. I might be able to make iterate work with wraptag and break more intelligently if there’s a lot of demand for the functionality.

Last edited by spchampion (2005-08-25 14:44:01)

Offline

#64 2004-11-21 00:35:59

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Hie Stanton,
my loading problem is solved. It was a select box which was placed on the same page as the section list. I went through the whole css first and did not think of the select box as the loading delay did solely occur in IE.

However, i am working on a very complex site and learnt more about the plug in. Its just great! It helps me a lot.

Many thanks for your constant replys.

Alex

Offline

#65 2004-11-21 01:53:02

nimby
New Member
Registered: 2004-10-21
Posts: 3

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

xxx-post (vit)

….what about zem’s nth plugin?

(lemme look for the link)

Offline

#66 2004-11-21 23:37:23

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

nimby, you’re right! zem’s excellent nth plugin would work very well in this circumstance.

Offline

#67 2004-11-22 19:17:48

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

I cannot get this to work. We’ve got a spot where we need to use the section_alias_article_link tag. I’ve debugged it up to this point…

==<code>
foreach($g_array as $g) {

print_r(“Before the IF… g=”.$g.” and section=”.$section.” and the last value is section.\n<br/>”);

if($spc_section_alias_hash[$g][$section][“section”])

{

print_r(“We got into the hash function thingy/n<br/>”);

$out = “”;

….
….
</code>==

The print_r’s are mine obviously. The print just before the IF statement for all the articles in question gives $g=“default” and $section=“sectionname” (and is the correct section for the article). However we don’t get into the if statement. $spc_section_alias_hash seems to be an array, not a function, so I’m assuming it’s looking for a value at default, sectionname, section. Why it’s not finding it, I’m not entirely certain, because we’ve defined everything earlier.

Any ideas?

EDIT: Nevermind, got it figured out. It needs a group specified and ergo, it was using default and that particular section wasn’t in default. (More debug would be still be nice though ;-)).

Regards,
Remillard

PS: As an aside, for really complex plugins like this one, I, for one, would really like to see effort put into some debug messages, maybe with a debug flag. I’d love to know why it’s not finding something and I could have jumped right to the problem rather than trying to put my own markers in the plugin and figure out why it’s not working. This isn’t aimed at spc_section_management in particular… just a general rant ;-).

Last edited by Remillard (2004-11-22 19:22:48)

Offline

#68 2004-11-22 21:21:04

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Okay, well all is well that ends well. I do have a suggestion (not a rant or anything like that).

As far as I can tell, the group parameter is in there to aggregate sections into well… groups. I think this is used for the iteration function for making lists of section links.

However, for the basic name and link, these are sort of utility functions. I would suggest that these functions do not need to read group as a parameter. You can’t have sections with the same name, so checking against the group seems superfluous.

Specifying group for the iteration functions seems to make a lot of sense however.

Perhaps the group specification can be taken out for these functions, or made to default to ALL groups, when you’re simply trying to create a section named link (or just a section name.)

Okay well that’s about it.

Remillard

Offline

#69 2004-11-22 23:17:10

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Remillard, you CAN have sections with the same name in different groups. In fact, that feature comes in handy if you want to use the “this” and copy functionality to redefine section names or characteristics on the fly.

When I first devised the group functionality, I figured that most people who would want to use the plugin would not care about grouping sections. For that reason, I designed it such that if you add a section entry and you do not define a group, it hides the grouping stuff entirely. In other words, the functionality you describe does exist if you never define a group to begin with. In fact, even if you do define a group, it will always use the “default” group in situations where you leave the group entry blank.

Starting with version 0.4, I added the ability to “aggregate” groups with comma separated lists. So if you have two different groups and you want to use one group one place, the other group somewhere else, and both groups at the same time in another place, you could say group=“1”, group=“2”, or group=“1,2”. If one of your groups is the default group, you could even say group=“default, my-group” or something like that.

I’ll admit that the grouping bit is kind of clumsy, but it solves a big problem with making this plugin work on larger and more complicated sites. However, if you do not need to group your sections, then by all means ignore the group keyword entirely. The plugin works just fine if you leave it off and it will assume that every section you add goes in the same “default” group. This is true for all of the plugin functions (except for copy).

Last edited by spchampion (2004-11-22 23:19:17)

Offline

#70 2004-11-23 06:44:07

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Thanks for the information. I didn’t realize you could apply more than one group.

However my point is only for the very basic functions. Do you need to check against group when doing a section alias link title, or a section alias link? I couldn’t come up with a reason for doing it on those functions. I realize the groups serve an important function for the large scale group iteration functions and whatnot. That could be very valuable function for creating navigation lists in various locations. I’m really only referring to the small scale functions.

I did finally figure it all out, but it took a lot of print_r statements to figure out why ;-).

Remillard

Offline

#71 2004-11-23 23:00:04

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

> However my point is only for the very basic functions. Do you need to check against group when doing a section alias link title, or a section alias link?

If you do not need the grouping functionality, you don’t have to use the group keyword with any of the functions.

If you do need the grouping functionality, then the ability to distinguish between the different groups in different places is really useful. For example, I may define a section to look one way in one group and another way in another group. If I call the _link function, which group should I use? You may not need anything that complex, but other people might. If you aren’t sure what group a section is in, then use the comma separated list.

But if you don’t need groups, don’t use the group keyword at all. It’s not required. It will work just fine without it.

Last edited by spchampion (2004-11-24 00:08:49)

Offline

#72 2004-11-23 23:14:58

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: [plugin] [ORPHAN] spc_section_alias - Section renaming and management plugin.

Mmmm… okay I didn’t realize there was a look involved. Obviously that would be a distinguising characteristic necessary for group. I think we made some groupings based on function, but did not understand what the grouping meant in terms of plugin functionality. That is to say, “it sounded like a good idea at the time”. :-)

Thanks for clearing me up.

Offline

Board footer

Powered by FluxBB