On Tue, Oct 28, 2008 at 7:34 PM, alinome.net <[EMAIL PROTECTED]> wrote:
>
> Updating a bit more docs.index.variables I had an interesting doubt:
> Are {title} and {:title} the same?
>
> I know {title} is a system variable that returns a calculated value,
> depending on the content of the actual "title" page variable (if the
> "title" page variable is empty, {title} returns the last part of the
> page name). So my first feeling was that {:title} will return the
> datum itself unchanged, or an empty string if not set, because it's a
> normal page data variable and it looks like a normal page data
> variable...
>
> I was wrong! It seems {:title} is a exception among the page data
> variables and doesn't return its plain datum, but the same calculation
> than {title}. Maybe the reason for this exception is to avoid
> mistakes, maybe there are more important reasons, but anyway I think
> the logic suffers... I mean, the following should work, in my opinion,
> but it doesn't:

It is true, the title variable is a special case for several
reasons--but primarily because it is used so extensively in things
like [[page|+]] and [(breadcrumb)], I didn't want there to be any
confusion or difficulty.  The cost of course is indeed that there's no
easy way to distinguish between them (that's the idea)!

> [if equal {:title} '']
> You didn't choose a title yet, so I have to calculate it myself, here
> you are: {title}.
> Please choose your own title as soon as possible because I don't like
> my calculated "{title}"!
> [if]
>
> What do you think?
>
> Besides the logic I miss, is there any way to check if "title the page
> data variable" has been set?

I'm not very enthusiastic about changing this because the title system
works so well. And it goes against the grain of many other BoltWire
features that make page names case insensivitive, variables, etc.
Wherever possible, spare the user of problems...  I'd rather have a
solution for this specific case...

My suggestion would be a custom conditional like

[if title page=some.page]...  Default: current page.

The function opens the page, extracts the data section and scans for
the title entry.  Probably about 3-4 lines and it would be fool proof.

You could do [if equal {page} {title}] but the page name might be the
table--and I don't think it would match anyway because the second one
would be capitalized... But those are not insurmountable, just another
approach.

Let me know if this doesn't work...

Cheers,
Dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to