Forums / General / Hard coded hash/id/? in demo templates

Hard coded hash/id/? in demo templates

Author Message

Sol Millin

Monday 14 April 2003 3:04:49 pm

In trying to understand ez3, I've noticed quite wide use of hard coded hash/id/? data in templates, eg.

pagelayout_section_5.tpl

http://www.bba.com/index.php/content/view/full/212/
(this one I think is calculated from datastructure)

/content/view/full/26/
(a fragment from pagelayout_section_3.tpl)

Is this an indication that the templates, etc. are hard coded to the data structures?

eg to contentobject_id's or hashes of same?

Could you give an idea of the extent of this 'hard coding' in templates?

An explanation of these number would be very useful both to me and many other new users, I'm sure.

With many thanks,

Sol Millin
byron bay
australia

Jan Borsodi

Tuesday 15 April 2003 1:10:34 am

The reason for hard-coded values are that the entire demo has a static setup with some dynamic elements here and there.
Had this been a real project it would have been much better to choose those hard-coded values trough related objects and grouping objects.

This ofcourse means that the demo design will only work with the demo data installed.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Scot Wilcoxon

Sunday 20 April 2003 6:38:51 pm

So instead of finding the News items the way 'demo' does, with
fetch(content,list,hash(parent_node_id,24,sort_by,array(array(priority)))), the News should be retrieved through a more general means?

Is there a way to find the folder with the name "News", then fetch its contents?

It is hard enough to find anything about fetch(), and I haven't found documentation for the "content" and "list" parameters, much less what can be done other than "list" and hash(...number...).

Sol Millin

Monday 21 April 2003 10:36:36 pm

Have a look in the ewiki under How to's for

3 XHT_Fetch Function

if you need some info on fetch.

Hope this helps.

Sol.

Scot Wilcoxon

Monday 21 April 2003 11:57:31 pm

I already had the wiki fetch page in a browser window. Didn't help.

In this case, how does one find the contents of a "News" folder..
fetch(...,class_filter_by(1)) [I see "1" for Folder in DB table ezcontentclass, but don't know if that is relevant]
to get list of folders, then use php code to search that list for "News" as the "name", and then fetch() that folder -- no, I don't know that folder's node_id nor whether it is within the undocumented fetch() results.

I also don't know what node_id to use for a search. I've been testing with the Demo code and can't get any fetch() result when aimed at my newly-created News folder (as mentioned in my query in the Setup & design forum). And that's just with a static reference, without trying this search step.