Mailing List Archive

Fixed story type to use non-fixed URI???
We have a general purpose story type named "Story", which is fixed. Soon
we will be launching a new section that will be comprised of non-fixed
stories, but "Story" would be ideal for the content we'll be creating
except the fact we want date-based URLs.

Because all our stories have always been single-page stories, and there
has never been discussion of moving away from this, we don't create page
elements as to not introduce another layer. However, I see now that
doing so would have helped me in this situation.

Unless I'm missing something, I'm left with creating a new story type
that is a duplicate of "Story" in all ways except that it is non-fixed,
or refactor my templates to somehow utilize utility templates. As I'd
rather not do either of these, is there a way to make a fixed story type
use the non-fixed URI syntax via a template?

Any other ideas?

If not, at least I can create a new output channel and have it include
templates from the existing output channel.

Chris

--------------------------------

Chris Schults
Web Developer
PCC Natural Markets
206-547-1222 x104
chris.schults@pccsea.com
http://www.pccnaturalmarkets.com
Re: Fixed story type to use non-fixed URI??? [ In reply to ]
On Dec 8, 2010, at 11:07 AM, Schults, Chris wrote:

> Unless I'm missing something, I'm left with creating a new story type
> that is a duplicate of "Story" in all ways except that it is non-fixed,
> or refactor my templates to somehow utilize utility templates. As I'd
> rather not do either of these, is there a way to make a fixed story type
> use the non-fixed URI syntax via a template?

Create a new output channel with its "Fixed URL" template including the date, and make it include templates from your main output channel. Then add it as an option to your Story element type. Then all that has to happen in the new section is users would create a Story, then add the new OC and remove the old OC.

That's more of a PITA for your users, though. What I've done in the past is to create a duplicate story as you described, but instead of utility templates, you just make the template call the original template. So if your new story type is called dated_story, then dated_story.mc would be something like this one-liner:

% $m->comp('/story.mc', %ARGS);

Best,

David
Re: Fixed story type to use non-fixed URI??? [ In reply to ]
I second David's suggestion about the second OC, and just using the same
element type and the same template as for the stories with dated URIs.

If the new section with the fixed URIs is in its own category, you could
make a category template that checks the OCs and reassigns them if
necessary, which would cut down on the user hassles too.

Hope this helps,

Bret


On Wed, 2010-12-08 at 12:27 -0800, David E. Wheeler wrote:
> On Dec 8, 2010, at 11:07 AM, Schults, Chris wrote:
>
> > Unless I'm missing something, I'm left with creating a new story type
> > that is a duplicate of "Story" in all ways except that it is non-fixed,
> > or refactor my templates to somehow utilize utility templates. As I'd
> > rather not do either of these, is there a way to make a fixed story type
> > use the non-fixed URI syntax via a template?
>
> Create a new output channel with its "Fixed URL" template including the date, and make it include templates from your main output channel. Then add it as an option to your Story element type. Then all that has to happen in the new section is users would create a Story, then add the new OC and remove the old OC.
>
> That's more of a PITA for your users, though. What I've done in the past is to create a duplicate story as you described, but instead of utility templates, you just make the template call the original template. So if your new story type is called dated_story, then dated_story.mc would be something like this one-liner:
>
> % $m->comp('/story.mc', %ARGS);
>
> Best,
>
> David
>
>

--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret@pectopah.com
www.pectopah.com
RE: Fixed story type to use non-fixed URI??? [ In reply to ]
> Create a new output channel with its "Fixed URL" template including
the
> date, and make it include templates from your main output channel.
Then
> add it as an option to your Story element type. Then all that has to
> happen in the new section is users would create a Story, then add the
> new OC and remove the old OC.

Thanks David. This is the route we're going to take as the primary
manager of this section is cool with it.

> % $m->comp('/story.mc', %ARGS);

And thanks for this snippet -- very handy!

Chris