Hi Folks,
May have a mental block or making this more complex than needed but having re-read and re-read the designs manual I can't work out how to do something.
I have pages that (roughly) follow this heirarchy…
[codebox]
Site
|__Section
|__Sub-Section
|__Page
|__Section
[/codebox]
So what I want (and using the headings as an example - wont implement like this exactly)
[codebox]<h1>Site Name</h1>
<h2>Section Name</h2>
<h3>Sub-Section Name</h3>
<h4>Page Name</h4>[/codebox]
So I could do something like:
[codebox]<MySource_AREA id_name="section_name" design_area="asset_lineage" print="no">
<MySource_SET name="levels_to_print" value="-1" />
<MySource_SET name="prefix_with_home_link" value="false" />
<MySource_SET name="show_hidden_links" value="false" />
<MySource_SET name="suffix_with_current_link" value="false" />
<MySource_SET name="prefix_with_divider" value="false" />
<MySource_SET name="suffix_with_divider" value="false" />
<MySource_SET name="unwanted_asset_types" value="user folder" />
<MySource_SET name="reverse_lineage" value="false" />
<MySource_ASSET>
<MySource_PRINT var="asset_name" />
</MySource_ASSET>
</MySource_AREA>
<h1><MySource_PRINT var="site_name" /></h1>
<h2><MySource_PRINT id_name="section_name" /></h2>
<h3><MySource_PRINT var="asset_name" /></h3>
[/codebox]
Which works for the sub-section level but that doesn't work if you go up or down a level. What you would need is something like says 'show level in tree' or something. Which might exist and I'm just not seeing it?
Any help / point in the right direction appreciated.
Why not use a Menu design area instead?
well there is likely to be other html (including menus) between headings... without going into too many details (boring) there is a new design in the offing that I am adapting, so don't have 100% control over structure of the page etc
Hmm... do you only ever have two levels below the site, i.e. Section and Sub-section?
well Section / Subsection / Page... want to avoid a breadcrumb trail (another feature of the design) 12 items long! ;-)
Real World Example:
Site: 'My Site'
Example Section: 'Events'
Example Sub-Section: Seminars (other event types could be conference, workshops etc)
Example Page: 'Upcoming' (others are historical pages 2007, 2006 etc).
The menus will consist of one listing the sections on the right and within a section another listing the sub-section pages on the left with a SUB clamshell showing the 4th level when you are in that section (but of course the pages could 'stop' at the sub-section level within some sections).
Can put together a wireframe tomorrow if that helps? (if I could work out how to remove the 'Client Name' info this forum I'm go into the politics / problems more ;-)
Wireframe would be useful to try and visualise what you're trying to achieve. Also, no-one sees the Client Name except you and the Squiz Staff members. You might notice that you don't see other members' client names. :)
well long story - I love your product but am under serious pressure to use a different one (i'm semi autonomous in that regard) that can't do half as much (hence why I've been unable, politically rather than financially, to get the SSV version... Yet! ;-) Getting around this by 'shadowing' the designs produced by the administrative centre for use in MSM. The latest incarnation is staggering in its lack of usability. I'm trying to work out the kinks by adjusting it for my use but struggling with the above issue. Will come clearer when I post the wireframe tomorrow AM CET.
Ok, Have some wireframes done.
When I page exists at the 'subsection' level - the page needs to inherit the parent's name for the section name. if a subsection has has children…
… the page needs to set the page's grandfather that to be section name. Thats why it can't be relational, but absolute from the site down I reckon. Also can't have 2 designs or 2 customisations (one per level) as I've already tried getting people to use different designs etc and they are just not 'getting it' so would prefer a more systematic solution.
As an added wrinkle the subsection name only appears if there is content to populate the element (although can probably use javascript to sort that).
Any ideas?
Some, but I need to play with it to see what works and what doesn't. 1, 2, 3, 4 and 7 are all easy to do with standard menu design areas. 5 and 6 are more tricky.
What happens if there are pages lower than HHH? Would 6 become HHH and 5 become JJJ (for example)? Or would 6 stay EEE and 5 become JJJ?
...well while you ponder - how would you do 3? (parent / grandparent)
[quote]What happens if there are pages lower than HHH? Would 6 become HHH and 5 become JJJ (for example)? Or would 6 stay EEE and 5 become JJJ?[/quote]
Aha - you've discovered the flaws in the design ;-) Truthfully I think the way I will implement is to have JJJ come 5 (as that will be the page title 'asset_name') and append HHH to FFF as the subsection name
FFF: HHHJJJ</pre>
That appears to be a single level lineage -- i.e. a lineage design area with levels_to_print=1 and all the prefixes disabled. I'm onsite at a client all day today and tomorrow, so I'm not sure when I'll get a chance to play with this.
I think I can (ab)use the menu design area to do it all, but performance is going to be interesting. You would land up with three different menu design areas on a single page. Depending on the size of the site, this could take a while to process.
This is a total hack/proof-of-concept. I created a site the same as your diagram and it mostly works the way you expect:
[html]<html>
<head>
<title>Design Test</title>
</head>
<body>
<h1>1. Site Name: <mysource_print id_name="global" var="site_name" /></h1>
<h1>2. Top Level Navigation</h1>
<mysource_area id_name="top_level" design_area="menu_normal">
<mysource_set name="level" value="top" />
<ul>
<mysource_asset>
<li><mysource_print var="asset_name_linked" /></li>
</mysource_asset>
</ul>
</mysource_area>
<h1>3. Section Name:
<mysource_area id_name="section_name" design_area="asset_lineage">
<MySource_SET name="levels_to_print" value="1" />
<MySource_SET name="prefix_with_home_link" value="false" />
<MySource_SET name="suffix_with_current_link" value="true" />
<MySource_SET name="prefix_with_divider" value="false" />
<MySource_SET name="suffix_with_divider" value="false" />
<mysource_asset><mysource_print var="asset_name" /></mysource_asset>
</mysource_area>
</h1>
<h1>4. Sectional Navigation</h1>
<mysource_area id_name="sectional_navigation" design_area="menu_normal">
<mysource_set name="level" value="1" />
<ul>
<mysource_asset>
<li><mysource_print var="asset_name_linked" /></li>
</mysource_asset>
</ul>
</mysource_area>
<h1>5. Page Title: <mysource_print id_name="global" var="asset_name" /></h1>
<h1>6. Sub-section Name:
<mysource_area id_name="subsection_name" design_area="asset_lineage">
<MySource_SET name="levels_to_print" value="2" />
<MySource_SET name="prefix_with_home_link" value="false" />
<MySource_SET name="suffix_with_current_link" value="true" />
<MySource_SET name="prefix_with_divider" value="false" />
<MySource_SET name="suffix_with_divider" value="false" />
<MySource_SET name="reverse_lineage" value="false" />
<mysource_asset><mysource_print var="asset_name" /></mysource_asset>
<mysource_divider> : </mysource_divider>
</mysource_area>
</h1>
<h1>7. Sub-section navigation</h1>
<mysource_area id_name="subsectional_navigation" design_area="menu_normal">
<mysource_set name="level" value="2" />
<ul>
<mysource_asset>
<li><mysource_print var="asset_name_linked" /></li>
</mysource_asset>
</ul>
</mysource_area>
</h1>
</body>
</html>[/html]
I did wonder about this as I have a few sites with more than one menu area and i've not bothered caching them... is it worth it?
Almost - the only one that doesn't work is 6 - as its prefixed by the section name:
[codebox]BBB: FFF: HHH[/codebox]
Rather than just
[codebox]FFF: HHH[/codebox]
Would need something like (but of course isn't an option):
[codebox]
<MySource_SET name="start_at_level" value="2" />
<MySource_SET name="levels_to_print" value="1" />
[/codebox]
Pity CSS3 isn't around much as the nth child could hide the first one.
If you could handle HHH : FFF, then set reverse_lineage to TRUE. That might be acceptable.
Might put in a feature request as it looks like it would be 3/4 lines of code to add that 'start at level' option (but not going to bother adding myself as I learned years ago hacking code into a product makes maintenance a headache even if it is GPL ;-)
Cheers for the help Avi...
K
If you write the code yourself, it is easier for us to put it into the core. :)
HA! not as easy as it looks ;-) Ok - in the file (where I thought it would go):
core/assets/designs/design_areas/design_area_asset_lineage/design_area_asset_lineage.inc
I've 'cloned' the bit of code for the levels_to_print and tweaked it slightly for a start_at_level option. Added that new type to the sq_ast_attr table and also added it as an array to:
design_area_asset_lineage_management.inc
...what else have I missed / need to tweak to enable it? Or are there custom asset docs anywhere that presumably explain this in detail?
Cheers
K
Once you add an attribute to a _management.inc class, just re-run step_03.php -- the installer will then add all the appropriate entries to the database for that attribute. You may also have to change the XML files if you want to expose that attribute in the Administration Interface (i.e. when customising the design area).
The best place to look for documentation on development is the Developer Tutorials on the Matrix website.
Hi, I have tested and added this feature (http://bugs.matrix.squiz.net/view_bug.php?bug_id=2925) . It will be in the 3.18.0 release next month as Greg said. Thanks a lot for the contribution.