Jump to content

peterfoeng

Members
  • Posts

    95
  • Joined

  • Last visited

Posts posted by peterfoeng

  1. Hi guys,

    I just purchased this great module for the website I am working on and it's fantastic :) I do have a question though but I am not sure what kind of caching result I should be expecting but here goes my case study:

    I have a page setup like so: http://tympanus.net/Tutorials/ThumbnailGridExpandingPreview/ (this is a sample site but my setup is very similar) every thumbnail is a link and whenever the link is clicked, it will create an ajax request with jquery calling a page with a querystring prepend to the end of the url. My processwire main template is 1 main template called Default.php and many views depending on the template name (this is based on the example on the forum); so whenever Default.php capture the request, it will look into the querystring, if the querystring present it will just print the page without all the stylesheet/js/etc (see below):

    <?php
    
      if($input->get->PW_TEMPLATE_NAME !== null) {
        $pageViewTemplate = $config->paths->templates . "views/{$page->template}.inc";
        if ( is_file($pageViewTemplate) ) {
            include($pageViewTemplate);
            return;
        }
      }
    ?>
    
    <!DOCTYPE html>
    <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
    <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
    <!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
      <head>
        <meta charset="utf-8">
    
     etc etc...

    But whenever the querystring "PW_TEMPLATE_NAME" is not present then it will render the whole page with the stylesheet/js/etc (my setup as a fallback if the javascript is disabled, so people can see the page as if it is a link to a page). My question: can procache caches both of the versions: one with full template and one without the full template? as the output of the page is depending upon the querystring. Because when I try to enable the cache on this template, it only cache the one that render the whole full page, as a result whenever an ajax request is made the preview shows the whole page instead of just body copy.

    I hope someone can explain how this might work or might not work :) This is a great module in itself :) Cheers

  2. Hi Soma,

    Thanks for pushing through this update, I may not be able to share my code but the latest update solves the issue I am having with the selector_leveln :)
     

        'selector_level1' => 'id=1044',
    
        'selector_level2' => 'gallery_item=1',
     
  3. Hi Soma,


    Thanks for the reply :) I solved the first issue I am having using the xtemplates since the structure is setup like the following:

    Menu -> (template: Menu-Index)
     Menu-Category-1 ->(template: Menu-Category)
       Menu-Item-1 ->(template: Menu-Item)
       Menu-Item-2 ->(template: Menu-Item)
     Menu-Category-2 ->(template: Menu-Category)
       Menu-Item-1 ->(template: Menu-Item)
       Menu-Item-2 ->(template: Menu-Item)
     Menu-Category-2 ->(template: Menu-Category)
       Menu-Item-1 ->(template: Menu-Item)
       Menu-Item-2 ->(template: Menu-Item)
     Menu-Category-2 ->(template: Menu-Category)
       Menu-Item-1 ->(template: Menu-Item)
       Menu-Item-2 ->(template: Menu-Item)
    
    etc
    
    

    I am able to setup the page structure like the following:

    <div>
      {$page->title}</h3>
      <ul>
        <li>Sub item 1</li>
        <li>Sub item 2</li>
        <li>Sub item 3</li>
      </ul>
    <div>
    <div>
      {$page->title}</h3>
      <ul>
        <li>Sub item 1</li>
        <li>Sub item 2</li>
        <li>Sub item 3</li>
      </ul>
    <div>
    

    Great module and if we get support for item position class - this is very powerful module. Cheers

  4. Hi guys,

    I have two questions regarding this module to see if it is possible to:

    output something like (basically 2 level navigation but with custom parent output):

    <div>
      {$page->title}</h3>
      <ul>
        <li>Sub item 1</li>
        <li>Sub item 2</li>
        <li>Sub item 3</li>
      </ul>
    <div>
    <div>
      {$page->title}</h3>
      <ul>
        <li>Sub item 1</li>
        <li>Sub item 2</li>
        <li>Sub item 3</li>
      </ul>
    <div>
    etc
    

    also can we output custom class based on the position of the menu item? Say I want every second item in the list (item 2, item 4, and so on) to have a class 'second-item-position'

    <ul>
      <li>item 1</li>
      <li class="even">item 2</li>
      <li>item 3</li>
      <li class="even">item 4</li>
    </ul>
    

    This is my first post and thanks Soma for this beautiful module - as I am building my first PW site so I am still not that familiar with the API but the community here is fantastic and I am looking forward to post my first studycase using PW

×
×
  • Create New...