just curious if there’s a way to carry variables with you to the next template, I thought (coming from a PHP background) that posting variables would be a way, but this would have a form requirement.
Here’s an example to illustrate my point
I have several templates currently that basically do the same thing, but
with small variable changes. Here’s an index
{html_head}
{embed="multiverse/.html_header" page_title="Product" body_class="p-product"}
{embed="multiverse/.navigation"}
{embed="products/.dynamic_feature-block"}
{embed="products/.products_module" chan="products" cat_id="3" stat="featured|open" limt="12"}
{embed="multiverse/.html_footer"}
{html_close}and here’s a sample of one of the product pages (Laptops in this scenario)
{html_head}
{embed="multiverse/.html_header" page_title="Laptops" body_class="p-product"}
{embed="multiverse/.navigation"}
{embed="products/.dynamic_feature-block"}
{embed="products/.products_module" chan="products" cat_id="6" stat="featured|open" limt="12"}
{embed="multiverse/.html_footer"}
{html_close}You can see that the only “Actual” differences between these two are
A: Page title
B: Category ID number
Not a whole lot eh?
So here is a chance that I can basically clip the 7 templates, and recycle
them using one master instead. I guess the real question is, how would I carry over
those variables from one page to the next, so on .products_module
<section id="{embed:chan}" class="product-content">
<div class="wrap">
<hgroup>
<h1>Routers</h1>
<ul id="prod-subnav">
<li><a href="http://{path=">Routers</a></li>
<li><a href="http://{path=">Mobile</a></li>
<li><a href="http://{path=">Laptop</a></li>
<li><a href="http://{path=">Tv & DVR</a></li>
<li><a href="http://{path=">USB</a></li>
</ul>
</hgroup>
<ul class='list-column-3'>
{exp:channel:entries channel="{embed:chan}" category="{embed:cat_id}" status="{embed:stat}" limit="{embed:limt}" paginate="bottom"}
{if no_results}No Products in this Channel, check channel info?{/if}
<li>
<hgroup>
{if product_blurb_image}{product_blurb_image}{/if}
<h1>{title}</h1>
{product_blurb}
<!--/** Something like this maybe?
*
* <?php
* $assign_to_config['global_vars'] = array("{title}" => array(
* "category" => "{cat_id}",
* "title" => ucwords("{category_name}"));
* ?>
*
*/ -->
</hgroup>
<a href="http://{embed:chan}/{url_title}class=red-btn">Learn More</a>
</li>
{switch="||</ul><ul class='list-column-3'>"}
{paginate}
<li>Page {current_page} of {total_pages} pages {pagination_links}</li>
{/paginate}
{/exp:channel:entries}
</ul>
<div class="clear"></div>
</div><!--/wrap-->
</section><!--/{embed:chan}-->