We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50485
    • 56 Posts
    Hi

    This is probably a stupid newbie question. I am creating a site which lists historic buildings in our town. I want to allow a user on my site to a) create the pages for each building (from an example resource and associated template I have created) and b) add a brief entry for each building on a listing page, including the link to the full details page . I have figured how to allow a user to add resources at root, but cannot find out how allow the user to add a link to the page they have created. I can only find out how to create links myself in templates.

    Thanks!

    Missusdoubleyou
      • 4172
      • 5,888 Posts
      what's your html-code, currently, for the listing?

      Usually, you would have a container-resource and the buildings as sub-resources in that container.
      Than you can build the listing dynamically with getResources (or pdoResources).

        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 50485
        • 56 Posts
        Hi Bruno

        Thanks for replying. The listing page is divided into four categories for different types of building, so each section or category would have a number of entries. Below is the code for one category:

        <section class="category" id="religious">
        			<div class="inner">
        				
        				<!--<p id="page-intro"><a href="#religious">Religious</a> | <a href="#domestic">Domestic</a> | <a href="#commercial">Commercial</a> | <a href="#military">Military</a></p>-->
        				
        				<a id="religious-section"></a>
        			
        				<h3>RELIGIOUS<span class="additional-info"> BUILDINGS</span></h3>
        			
        				<!--RELIGIOUS ENTRY-->
        			
        				<div class="building-category-entry">
        				
        					<div class="category-entry-name">
        						<h4><a href="buildings/building-template.php">Building name</a></h4>
        						<p class="address">Building address</p>
        						<p class="what-and-when">Sentence on what it is and when built</p>
        	
        					</div><!--category entry name ends-->
        				
        					<div class="thumbnail-container">
        						<img class="thumbnail" src="images/category-thumbnail.png" alt="building name" />
        					
        					</div><!--thumbnail container ends-->
        				
        				</div><!--entry ends-->
        				
        			<!--RELIGIOUS ENTRY-->
        			
        				<div class="building-category-entry">
        				
        					<div class="category-entry-name">
        						<h4><a href="buildings/building-template.php">Building name</a></h4>
        						<p class="address">Building address</p>
        						<p class="what-and-when">Sentence on what it is and when built</p>
        	
        					</div><!--category entry name ends-->
        
        				
        					<div class="thumbnail-container">
        						<img class="thumbnail" src="images/category-thumbnail.png" alt="building name" />
        					</div><!--thumbnail container ends-->
        				
        				</div><!--entry ends-->
        				
        				<div class="type-triangle-down">
        						<a href="#domestic-section"><img src="images/triangle-down-black.png" alt="Go to Domestic Buildings" /></a>
        					</div>
        			
        			</div><!--inner relgious category ends-->
        		</section><!--religious category ends-->
        		
        
          • 4172
          • 5,888 Posts
          In that case, you would create a container-resource for each category.

          You would have an outer getResources - snippet, which lists the categories.
          Something like that in your listing-template:

          [[getResources?
          &parents=`0`
          &tpl=`tplCategory`
          ]]


          create a chunk with name 'tplCategory' and code like that, with another getResources-snippet in it, to list the buildings:
          <section class="category" id="[[+alias]]">
              <div class="inner">
                           
                  <!--<p id="page-intro"><a href="#religious">Religious</a> | <a href="#domestic">Domestic</a> | <a href="#commercial">Commercial</a> | <a href="#military">Military</a></p>-->
                           
                  <a id="[[+alias]]-section"></a>
                       
                  <h3>[[+pagetitle]]<span class="additional-info"> BUILDINGS</span></h3>
                       
                  [[getResources?
                    &parents=`[[+id]]`
                    &tpl=`tplBuilding`
                  ]]
                           
                           
                  <div class="type-triangle-down">
                      <a href="#domestic-section"><img src="images/triangle-down-black.png" alt="Go to Domestic Buildings" /></a>
                  </div>
                       
              </div><!--inner relgious category ends-->
          </section><!--religious category ends-->
          


          your chunk 'tplBuilding'

                          <!--ENTRY-->
                       
                          <div class="building-category-entry">
                           
                              <div class="category-entry-name">
                                  <h4><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h4>
                                  <p class="address">[[+tv.address]]</p>
                                  <p class="what-and-when">
                                  [[+introtext]]
                                  </p>
               
                              </div><!--category entry name ends-->
                           
                              <div class="thumbnail-container">
                                  [[getImageList.... or whatever images-solution you would prefer]]
                               
                              </div><!--thumbnail container ends-->
                           
                          </div><!--entry ends-->
          
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 50485
            • 56 Posts
            Hi Bruno

            Many thanks, I was beginning to think GetResources was the answer and you have just completely clarified this. Again, thanks,

            Missusdoubleyou