I have a custom node page that loads job content dynamically using a custom module based on a value from the query string. I'd like to customize the so that it matches the title of the job that is dynamically loaded. I used hook_metatag_metatags_view_alter() to override the which works on the first view of the page but additional views with different query string arguments result in the continuous display of first viewed job's title. Is there anything that can be done to prevent the title from caching.

Comments

christian deloach’s picture

So I thought I may be able to address this by using the token [current-page:query:?] where "?" I replaced with the query string argument. Again, this worked on my first viewing of the page but subsequent viewing of the page with different query string values resulted in the redisplay of the based on the first page visit so changes to the query string have no effect until the cache is cleared.

damienmckenna’s picture

Basically no, there isn't a way of doing this.

Where is the job data stored? I would suspect there might be a better way of handling the job data that would be compatible with Metatag. Do you have the site's page caching disabled?

christian deloach’s picture

Hi DamienMcKenna,

Thank you for the quick response.

The job data is being pulled from Salesforce using Salesforce's API. The content is loading using mymodule_node_view() by adding addition content to the node's content. I'm using a basic node page as the placeholder for the module's content. I'm open to suggestions on how to embed the module's content without using a node page, i.e. mymodule_menu().

Page caching is turned off on my development site so you are correct, page caching is disabled. I was logged in as an administrator when I came across the cache issue.

damienmckenna’s picture

Status: Active » Fixed

You might try using hook_metatag_page_cache_cid_parts_alter() to have it check the URL arguments.

damienmckenna’s picture

Status: Fixed » Closed (fixed)