Skip to main content
Jacobsky
Participant
March 23, 2017
Answered

How to nest an editable optional region inside a repetitive region

  • March 23, 2017
  • 3 replies
  • 819 views

Hi,


I am starting to work with Dw templates. I am trying to nest an editable optional region inside a repetitive region and the problem is that each time a new repetitive region is inserted, the nested editable optional region bears the same name, so any modification of the template modifies all editable optional regions with the same name.


How to resolve this problem ?


Thansk for any hint.


Jacob

[Moderator: moved from Creative Cloud to Dreamweaver Support forum.]

    This topic has been closed for replies.
    Correct answer Nancy OShea

    Sorry, you cannot nest regions.  It won't work.  You need unique region names and they must be closed before you can insert another one.

    <!-- Repeating Region1 starts here -->

    some content

    <!--end repeating region-->

    <!-- Optional Region2 starts -->

    optional repetitive element

    <!-- Optional Region end -->

    <!-- Repeating Region3 starts here -->

    some content

    <!--end repeating region-->

    and so on....

    3 replies

    B i r n o u
    Legend
    November 30, 2020

    in fact you can nest editable region in conditionnal region , themselves into repeat region... just think to be clear in what and how you write it...

    I do that very often, (when website cannot be run from web server, run from USB without portable xampp) it works like a charm. I peronnaly don't use the DW generating code, I write template's code (comments) directly by hand, it'is more controllable

    here , downbelow is a working sample... in that state only region 1 will be available... if you invert definition of 1 being false and 2 being true, you'll get the opposite

    however, I have to admit that since the live view engines appeared in the DW IDE, it makes us all the more careful about such uses... sometimes, when we play with a lot of variables, and we change their values along the way, we should not hesitate to save the doc, change the values, save the doc again, close the doc, and reopen the doc to changes being took into account

    arrays are missing as possible values of template variables and we have been asking for them for years (since macromedia) with some template users.

    anyway... that's the way it is...

     

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Document sans nom</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateParam name="OptionalRegion1" type="boolean" value="true" -->
    <!-- TemplateParam name="OptionalRegion2" type="boolean" value="false" -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    
    <body>
    <h1>Titre</h1>
    
    <!-- TemplateBeginRepeat name="RepeatRegion1" -->
    	
    	<h2>Repeat region</h2>
    	
    	<!-- TemplateBeginIf cond="OptionalRegion1" -->
    		<h3>Static Content 1</h3>
    		<!-- TemplateBeginEditable name="EditRegion5" -->
    			Editable content for region 1
    		<!-- TemplateEndEditable -->
    	<!-- TemplateEndIf -->
    	
    	<!-- TemplateBeginIf cond="OptionalRegion2" -->
    		<h3>Static Content 2</h3>
    		<!-- TemplateBeginEditable name="EditRegion4" -->
    			Editable content for region 2
    		<!-- TemplateEndEditable -->
    	<!-- TemplateEndIf -->
    
    	<p>Same content for both condition</p>	
    	
    <!-- TemplateEndRepeat -->
    
    </body>
    </html>
    toshi_esumi
    Inspiring
    December 1, 2020

    Your example has one editable inside of one optional. Have you tried opposite and multiple optionals inside one editable?

     

    Toshi

    B i r n o u
    Legend
    December 1, 2020

    Basically it is not the question of the OP wanting to nest an optional editable region within a repeated region.

     

    Your question is within the limits of the caution I advocate at the very beginning of my post, which consists in making sure that we are clear about what we want and how to achieve it.

     

    you are asking to include elements (whatever they are, and even if they are optional) in a region that is itself editable.


    But an editable region is essentially empty of other elements controlled by DW itself. This area is freely accessible, and therefore contains elements that can be directly modified by the user.

     

    if you want to insert, by concept, optional elements within an editable content, why not insert them by default within the template in the editable region, free to the user to remove them or to leave them in the child page. (Once again, this is no longer the responsibility of DW but of the user. Don't forget, that the concept of templates is to give DW control over the organization of the content.)


    Do you have a concrete example of such a use case of what you're asking for?

     

    Jon Fritz
    Community Expert
    Community Expert
    March 23, 2017

    Here's Adobes "How to" on DW Templates: How to design web pages based on Dreamweaver templates

    toshi_esumi
    Inspiring
    November 30, 2020

    This post was back in 2017. But even at the end of 2020 with 21.0, this doesn't seem to have changed. Is there any plan to make optional regions independent from editable reagions in templates in the near future?

    Especially with some Bootstrap+modal pages while other pages are relatively static, I want to make the main content area as one editable region, then set some parts inside of the main content optional.

    If would make templates much more flexible and "great!".

     

    Toshi

    Nancy OShea
    Community Expert
    Community Expert
    March 23, 2017

    I don't know what you mean by a repetitive region. 

    The way DW Templates work, you have to create an Editable Region for content that changes from page to page.  Or an Optional Editable Region for items that may appear on some but not all pages. 

    You cannot nest Editable Regions.

    Everything outside Editable regions is populated globally by the main Template.dwt file.  I suppose that's what you mean by repetitive region?  So as an example, your main Template contains a global header, footer & navigation element.     The page specific content comes from editable regions in child pages.

    Does that help you?

    Nancy

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    March 23, 2017

    The OP is likely talking about Repeating Regions....