Help - Search - Members - Calendar
Full Version: Searching by individual and category archives
Movable Type Community Forum > Using Movable Type > Additional Features
tegmine
So, I have this:

CODE
<h3><MTSwitch value="[MTBlogID]"><MTSwCase value="2">
<a href="<$MTBlogURL$><$MTCategoryDescription dirify='1'$>.html#<$MTEntryID$>"><$MTEntryTitle$></a>
</MTSwCase><MTSwDefault><a href="<$MTBlogURL$><$MTEntryTitle dirify='1'"$>.html"><$MTEntryTitle$></a></MTSwDefault>
</MTSwitch></h3>


Which fails. Any ideas on how I can get what I want here?
maddy
Can you describe in detail what it is you're trying to achieve with that piece of code? And what about it isn't working? smile.gif
tegmine
The previous code I put together didn't work because the MTCategoryDescription was outside of the context of MTEntryCategories, and so didn't make any sense.

At the moment I have this:

CODE
<MTRegexDefine name="cat">s/^\d\../$1/i</MTRegexDefine>

<MTIfEqual a="[MTBlogID]" b="2">
<a href="<$MTBlogURL$><$MTEntryCategory dirify='1' regex='cat'$>.html#<$MTEntryID$>"><$MTEntryTitle$></a>

<MTElse><a href=\
"<$MTBlogURL$><$MTEntryTitle dirify='1'"$>.html"><$MTEntryTitle$></a></MTElse>

</MTIfEqual>


The regex works (the first one I've ever written), but I get this error message:

Use of uninitialized value in substitution iterator at (eval 24) line 1.

I have categories like:

1. Category One
2. Category Two

And, want the search engine to return the MTEntryCategory as category_one.html#id

Any help with the regex would be appreciated?
tegmine
CODE
<MTRegexDefine name="cat">s/^\d\.\s(.*)/$1/</MTRegexDefine>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.