Back to ProBlog Support

laics19845002
laics19845002

Hi there,

anyway to get the :filter and :slug value from the url and post it on the page of october cms directly? Thanks.

ChadStrat
ChadStrat

hmmm, great question. There are three accessible page vars available, but you will need to use some logic as to how/when to show them. The are conditional so only one is assigned at a time and the other two will be null.

  • blogCurrentCategorySlug
  • blogCurrentTagSlug
  • search_slug

ChadStrat

Last updated

ChadStrat
ChadStrat

To expound on that, if blogCurrentCategorySlug is present, then your filter is clearly 'category'. If blogCurrentTagSlug is present, then your filter is 'tag'.

{% if blogCurrentTagSlug %}
     {{ 'Tag'|_ }} / {{blogCurrentTagSlug}}
{% endif %}

ChadStrat

Last updated

laics19845002
laics19845002

Have applied the variables that you mentioned, yet no value returned.

my url is : /blog/tag/:slug?

{{blogCurrentTagSlug}} will do rite?

ChadStrat
ChadStrat

You have to be on a page that has those parameters assigned for {{blogCurrentTagSlug}} to work. If you merely go to /blog/tag/:slug?/ no, nothing will print out.

ChadStrat

laics19845002
laics19845002

Sorry i am new to this. can you give me an example on how it works?

ChadStrat
ChadStrat

so '/:slug?/' is a parameter that the component listens for. So when you are viewing a post, and you click on a tag, that URL should be /blog/tag/tag-slug/ wherein 'tag-slug' is the slug of the tag for lookup and 'tag' is the filter (filter posts by tag where tag is equal to slug). The plugin will then search posts that have that tag. Where '/tag/' == :filter? and '/tag-slug/' == :slug? , the plugin will then assign a page variable for use for the slug where /:slug?/ == {{blogCurrentTagSlug}} when :filter? is equal to 'tag', and similarly /:slug?/ == {{blogCurrentCategorySlug}} when :filter? is equal to 'category'.

Hope this helps. ChadStrat

laics19845002
laics19845002

yup. cool. get it done. one more thing, how can i display that in the title? possible?

laics19845002
laics19845002

Hi Chad, is there a way to get the :slug value from url even if :filter does not exist? if not can pls make it possible in the next release? Thanks.

1-9 of 9