In applying Authcache settings to an existing site I have encountered a problem where certain items hard-coded into the theme's page.tpl.php need to be personalised for each user. I could do it by moving those components into blocks and/or panels, but they are quite complex and I was wondering if a better approach would be to do it via the Authcache API using the authcache_usercookie.module example as a starting point.

Here is an example of the code I would like to personalise:

<?php if($page['topics_tab']): ?>
<div class="tabs-menu collapse hidden-print" id="topics-collapse-tab">
  <div class="container">
    <div class="row">
      <div class="col-md-8 col-md-push-2">
        <?php print render($page['topics_tab']); ?>
<?php endif; ?>

Is it possible (easy? difficult?) to modify page.tpl.php to make Authcache cache this snippet for each user, or should I redo the page using blocks/panels?


I recommend to redo the page with blocks (or panels). The Authcache User Cookie example is rather basic and does not demonstrate how to deliver fragments from the custom front controller.

Regrettably there is still not enough documentation on how to roll your own custom fragment renderer. Look at the api.php files and read through the numerous submodules to get the picture.

Last but not least, there are some (closed) support requests in the ticket tracker covering this issue, e.g. #2780485.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.