Controlling Page Layout with Templates Support Product Page

This topic was archived

highlighting lines of code and their numbers

Asked 03 Jan 2004 15:40:56
1
has this question
03 Jan 2004 15:40:56 Earl Kent posted:
I'm trying to go through your tutorial and I noticed that the lines of code you ask me to highlight when creating the conditional areas don't seem to match up with the start and end of each content area. I don't know if I made a mistake inputting the content into the code... but if you could give a further indication that I am highlighting the correct code by listing the actual code of the beginning and ending of each code area as well as it's line number, I would extremely appreciate it.

I am going to continue on with the tutorial following your directions exactly as written and hopefully this won't cause me any problems! Thanks

Replies

Replied 03 Jan 2004 15:58:10
03 Jan 2004 15:58:10 Earl Kent replied:
I think I found the problem! In the section where you ask me to highlight the code lines 119 through 136 to create the repeating region, I think you meant code lines 143 through 160? Please correct me if I'm wrong!
Thanks!
Replied 03 Jan 2004 16:19:04
03 Jan 2004 16:19:04 Earl Kent replied:
Once again...
Adding the Repeating region asks you to select lines 121 through 135... I think you meant 145 through 161.
I hope I'm right with this stuff, although I've looked at alot of code over the years, I'm strictly a WYSIWYG type of web designer being that I am a musician and a Choral Director!
Thanks
Replied 03 Jan 2004 17:20:45
03 Jan 2004 17:20:45 Brad Halstead replied:
Hi There

Initial Optional Regions (3)
Lines 83 through 97:
Beginning markup: <p>Content goes here!</p>
Ending Markup: <br>

After adding this optional region, you may notice that lines 27 through37 combine into one line now numbered 30. This also affects the head block multipleif block which Dreamweaver decides it's best to reorganize it as well.. from lines: 4 through 10 get changed to 4 through 14... (This may not affect everyones Dreamweaver because it depends on what their individual code rewriting settings are configured for...)

Lines 93 through 116:
Beginning Markup: <table width="100%" border="0" cellspacing="0" cellpadding="5">
Ending Markup: </table>

Lines 119 through 136:
Beginning Markup: <table width="100%" border="0" cellspacing="0" cellpadding="0">
Ending Markup: </table>

Adding the Repeating Region (1)
Lines 121 through 135:
Beginning Markup: <tr>
Ending Markup: </tr> (OF THE SECOND ROW OF THE TABLE)

Note: You might not see a new repeating element marker (Light blue in Design View) as it is slightly hidden behing the Optional Region marker named: If Layout_Repeating. It's nothing to be concerned about at this point as noted in the tutorial <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>!

Adding the Editable Regions

In the First optional region area
Lines 77 through 90
Beginning Markup: &lt;p&gt;Content goes here!&lt;/p&gt;
Ending Markup: &lt;/ul&gt;

In the second optional region area...
Content_TopLeft actually hilights Lines 97 through 99 in Code view but you use design view to select the table cell!

Content_TopRight actually hilights Lines 102 through 108 in Code view but you use design view to select the table cell!

Content_Bottom actually hilights lines 116 and 117 in Code view but you use design view to select the table cell!

In the Third Optional Region area...
Contact_Info_Left actually hilights lines Most of 130 through 133 but you use design view to select the paragraph.

Contact_Blurb_Left actually hilights part of line 136 but you use design view to select the paragraph.

Contacvt Info_Right actually hilights most of line 139 through 142 but you use design view to select the paragraph.

Contact_Blurb_Right actually hilights part of line 145 but you use design view to select the paragraph.

Does that help clarify it for you?


Brad Halstead
Co-author: Dreamweaver MX Templates, Dreamweaver MX Magic, Dreamweaver MX 2004 Magic
Replied 03 Jan 2004 18:02:28
03 Jan 2004 18:02:28 Earl Kent replied:
Thanks for the clarification. Great tutorial, it was exactly what I was looking for. I'm assuming that I should be able to add the same kind of optional areas to my templates now without adding any outside code that was inserted in your templates by default?
By the way, what was the template snippet mpx for? It never asked for any of it during the tutorial.
Replied 03 Jan 2004 18:16:20
03 Jan 2004 18:16:20 Brad Halstead replied:
Hi
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks for the clarification. Great tutorial, it was exactly what I was looking for. I'm assuming that I should be able to add the same kind of optional areas to my templates now without adding any outside code that was inserted in your templates by default?
By the way, what was the template snippet mpx for? It never asked for any of it during the tutorial.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Great news, thanks for your feedback <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

The snippets extension is for insertion of template markup in templates. Dreamweaver MX does some weird things sometimes with optional regions or repeating regions so we (Murray and I) made a snippets extension. An example would be try to make a cell a repeating region in a multi-columned table.. Dreamweaver assumes you want the row.. use the snippet to select a specific cell to repeat <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

As for adding optional regions query.. I'm not sure I understand the question.. you could add any amount of optional regins, then insert specific markup in each to reflect the desired layout. I simply find it easier to design the page then add the optional regions after the fact.. but to each their own.. does that answer your question?

Thanks

Brad Halstead
Co-author: Dreamweaver MX Templates, Dreamweaver MX Magic, Dreamweaver MX 2004 Magic
Replied 03 Jan 2004 21:02:19
03 Jan 2004 21:02:19 Earl Kent replied:
Brad,
Everything turned out great! When I inserted optional layouts into my Dreamweaver template and then tested it using Contribute, it worked like a dream.
Thanks again!
I do, however, have a template question that I hope you can answer for me.
My situation is this. I am building a secure contribute updatable website for the school system I work for. I'm trying to have only one base template that is updateable by me. I will be creating the html page structure myself. My contributers will only be putting content into that structure. They will not be able to create additional pages based on my template.
I have a site wide javascript controlled menu system that appears on every page with-in the site and because of the javascript (which I want to keep) this element can't be made into a library item.
I also have different section photos that appear at the top of every page within a section. Each one of these photos acts like a banner across the top of the section and is comprised of a series of photos stitched together.
My problem is this:
I don't see any way around creating a different template for each section because of having to replace the photo banner across the top of each section. Since I won't be able to make the javascript controlled menubar into a library item, this means that I will also have to make updates to that bar for each section. I will also have to make updates to the optional template regions per section.
My question is this! Can you think of any way that I could individually update the section photos from the base template thereby alleviating having do build section templates? I was initially planning on nesting templates, but I am very hesitant to do so after reading your recommendations.
Any ideas you could give me would be extremely appreciated.
Once again, Thanks for creating the tutorial, it gave me alot of insight into creating those template items.

Earl
Replied 04 Jan 2004 01:06:19
04 Jan 2004 01:06:19 Brad Halstead replied:
Hi Earl

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks again!
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

No problem at all <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> Thanks for letting us know.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
My problem is this:
I don't see any way around creating a different template for each section because of having to replace the photo banner across the top of each section. Since I won't be able to make the javascript controlled menubar into a library item, this means that I will also have to make updates to that bar for each section. I will also have to make updates to the optional template regions per section.
My question is this! Can you think of any way that I could individually update the section photos from the base template thereby alleviating having do build section templates? I was initially planning on nesting templates, but I am very hesitant to do so after reading your recommendations.
Any ideas you could give me would be extremely appreciated.
Once again, Thanks for creating the tutorial, it gave me alot of insight into creating those template items.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Hmm... interesting proposition...

Since the users won't be able to make any *new* pages from the template (I assume that they will be allowed to edit freely) then there is a little bit of a dilemma.

I would likely do an error checking routine and use parameters as outlined here: www.dmxzone.com/showDetail.asp?TypeId=28&NewsId=5824 however, that means that the parameter will be exposed to the Contribute user which, in turn, means that they can change the value of the parameter and hence the photo which isn't optimum.

So, if that is a concern, the only other way to do it (that I am familiar) is to use nested templates. In the parent template, make the image editable, in the nested template for each section, add a region lock @@(" "@@ to make this region uneditable to the Contribute user.

Please be advised that the Contribute user *MUST* have access to the template(s) or they won't be able to edit the pages. They still don't have to have the capability of making new pages but they still have to have access for editing.

There might be another method but it would require some finangling and seperate images for each section in it's own folder. Use a parameter (which will be exposed to a Contribute user) but also set the parameter to a document relative value in the template after the parameter definition, which means that no matter what the Contribute user sets the parameter to, the value is reassigned by the assignment (Best of both worlds really)

ie (in the templates head block):
&lt;!-- TemplateParam name="sectionimage" value="images/sectionimage.jpg" type="URL" --&gt;
&lt;!-- @@(sectionimage="images/sectionimage.jpg"@@ --&gt;

Then, where the image is to be displayed on the web page, use the following (assuming they are all the same size and alt attribute)...

&lt;img src="@@(sectionimage)@@" width="blah" height="blah" alt="blah"&gt;

Now, each section requires it's pages be in a unique sub-folder of the site

In each of these folders, there will be an images folder with the unique image per section...

That might work for you too...

Hope that helps.

PS: Your menu system might be able to work as a server-side include instead of a library item (Subject to your server specs of course)


Brad Halstead
Co-author: Dreamweaver MX Templates, Dreamweaver MX Magic, Dreamweaver MX 2004 Magic


Edited by - BradHalstead on 04 Jan 2004 01:09:06
Replied 04 Jan 2004 02:47:41
04 Jan 2004 02:47:41 Earl Kent replied:
Thanks Brad,
You present some interesting food for thought. I actually solved the problem using my new optional region techniques that you taught me.
I loaded all seven section photos into a seven row table at the top of the template and defined each photo as an optional region. While I was at it I turned the section links which reside on the left hand side of each page in a table cell into a library item and then loaded all seven library items into seven rows on the left hand side and made seven optional regions there too. Now I only have one template and when a Contributer first opens the page he needs to go into the template properties... turn on the correct top photo, left menu bar and install an editable region. It works fabulous and all I have to do is replace the individual jpg photos or edit the library items to make changes. Meanwhile my main menubar that lets you navigate to anywhere in the site is editable from within my one main template. I'm really glad I happened upon your tutorial because it ended up solving a lot of problems for me. Thanks again!
Earl

Reply to this topic