Gossamer Forum
Home : Products : Gossamer Links : Discussions :

version 3.0 beta: problem with category template sets when building

Quote Reply
version 3.0 beta: problem with category template sets when building
Hi.

I recently installed Links SQL 3.0 beta (or
version 2.99.0, to give it its official version
number). I'm having a problem when doing "Build
All", which seems to be due to a bug.

The problem arose as follows. I created
a category, at the highest level available
(i.e. just under the root), calling it "Kildare".
I assigned to this category a template set of
the same name (i.e. "Kildare").

On the server, I created a directory for
the template set, in cgi-bin/admin/templates.
Within this directory, I created the "local" and
"compiled" subdirectories, and I gave these 3
directories a mode of 777 (i.e. writable to all).
Into the Kildare directory, I then copied all
the files in the luna directory.

The actual problem is that when I try to "Build
All", the operation fails. The attached file
contains an extract from the page that appears
in the main frame of the window (i.e. the
frame containing the bottom right corner of the
window), showing the full stack trace. (I would
like to include the full page, but I don't want
to give away too much about our server, or the
site we're developing.) This stack trace seems
to show that the code is looking for a template
(as opposed to a template set) called "Kildare";
naturally, there's no such thing.

Regards,

Excalibur.
Quote Reply
Re: [excalibur] version 3.0 beta: problem with category template sets when building In reply to
The Category Template for a category, is a setting which makes Gossamer Links use a different template (not template set) for that category. So if you specify foo.html as the Category Template, then it will use foo.html instead of the default category.html when you enter that category.

Adrian
Quote Reply
Re: [brewt] version 3.0 beta: problem with category template sets when building In reply to
In Reply To:
The Category Template for a category, is a setting which makes Gossamer Links use a different template (not template set) for that category. So if you specify foo.html as the Category Template, then it will use foo.html instead of the default category.html when you enter that category.

Hi.

I hesitate to contradict a member of staff,
but are you sure? My local copy of the Links
SQL 2.2.0 Manual states, on page 21, which is
part of the section about the Browse menu:

The Category_Template field allows you to
designate the template set which will be
used to build the pages of the category you
are creating and its sub categories, if you
want a different template set to be used for
this category.

Further, I also have Links SQL 2.2.1 installed
locally, and the value in the Category
Template field clearly represents a template
set, not a template. For example, I have
a category in whose Category Template field
I have "galway". "galway" is a directory in
cgi-bin/admin/templates. It contains a "local"
subdirectory, and in this subdirectory are the
following files (among others):


  • add.html

  • include_menu.html

  • category.html

  • include_form.html

  • link.html



All these files are actually used for the
category in question, i.e. it's not just a
question of one category.html file being used.

If what you describe is a new behaviour,
introduced with version 2.99.0, that would be
disappointing, as we were planning to use this
feature in the site we're developing. Still,
we can probably figure out a way to get the
same effect.

Just to make sure that we're talking about the
same section of the administration interface,
I'm attaching a screenshot showing the part of
the GUI in which I change the Category Template
setting.

Regards,

Excalibur.
Quote Reply
Re: [excalibur] version 3.0 beta: problem with category template sets when building In reply to
I believe you can do both.

1) If you specify a template SET (i.e a folder in /admin/template/something/), then it will base of that whole tempalte set, for the particular category.
2) You enter foo.html, and it will use foo.html as the "category.html" template.

Hope that helps :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] version 3.0 beta: problem with category template sets when building In reply to
In Reply To:
I believe you can do both.

1) If you specify a template SET (i.e a folder in /admin/template/something/), then it will base of that whole tempalte set, for the particular category.
2) You enter foo.html, and it will use foo.html as the "category.html" template.

Hope that helps :)

Cheers

Hi.

Thanks, but it doesn't really. I want to be
able to specify a template set, and currently,
doing so with Links SQL 2.99.0 produces an error
condition. Being able to specify a replacement
for category.html is of little use to me.

Regards,

Excalibur.
Quote Reply
Re: [excalibur] version 3.0 beta: problem with category template sets when building In reply to
It looks like that's the case. I'll see what we can do to make things work with the beta.

Adrian
Quote Reply
Re: [brewt] version 3.0 beta: problem with category template sets when building In reply to
I took a look at the code again and it looks like everything (using a template set, or a template) should work like has before if you have your templates setup correctly.

Please check that your Category_Template template set contains the category.html template as well as a valid globals.txt.

In Reply To:
On the server, I created a directory for the template set, in cgi-bin/admin/templates. Within this directory, I created the "local" and "compiled" subdirectories, and I gave these 3 directories a mode of 777 (i.e. writable to all). Into the Kildare directory, I then copied all the files in the luna directory.
The proper way of doing this would be to use inheritance (any files which aren't in your template set will be pulled from the template set(s) that your template inherits from) and then only put your customised files in that template set directory. This way you will get all the changes made in future versions, and you won't have a whole lot of duplicated templates.

To inherit from another template set, create a .tplinfo file in your template set directory. The contents of the file should be:
Code:
{
inheritance => '../luna'
}
or if you wish to inherit from multiple templates:
Code:
{
inheritance => ['../luna', '../foo', '../bar']
}

Adrian
Quote Reply
Re: [brewt] version 3.0 beta: problem with category template sets when building In reply to
In Reply To:
I took a look at the code again and it looks like everything (using a template set, or a template) should work like has before if you have your templates setup correctly.

Please check that your Category_Template template set contains the category.html template as well as a valid globals.txt.

Hi.

Sorry for the delay in replying -- I got
sidetracked by other work.

I checked the Kildare directory containing the
files for the template set. There is a valid
globals.txt file, and there is also a valid
category.html file (I know they're valid because
they're identical to their counterparts in the
luna directory). Nonetheless, I'm still getting
this error message.

I tried setting "luna" as the Category Template
for another of my categories ("Meath").
One would expect this to work, since luna
came "out of the box". Unfortunately,
it fails, and with a similar error message:
Links SQL appears to want to open a file called
cgi-bin/admin/templates/luna/compiled/luna.compiled;
in other words, it seems to want to treat the
specified Category Template as both a template
set and a template. I'm attaching the stack
trace from the page I get.

Regards,

Excalibur.