• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Include a directory in blog post url?

Explorer ,
Aug 19, 2015 Aug 19, 2015

Copy link to clipboard

Copied

After opening a blog post in a certain category, I would like to be able to set the url to reflect the fact it's under that particular category...

At the moment the url looks like http://streeten-new.streeten.co.uk/blogname/blogpostname

Is it possible to somehow change this to display as  http://streeten-new.streeten.co.uk/blogname/categoryname/blogpostname ?

I couldn't see an obvious way, simply trying to set the blog post url to categoryname/blogpostname instead of just blogpostname didn't work because it didn't like the / symbol in the name.

Views

688

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

bump?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Yeah bump to this as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

Hi Luke,

If you go to a blog URL and click on category, it should display the URL as siteURL/blogURL/category/categoryname.

You can test it by going to blog on my test site: asdyuf  and click on a category on right side. Then check the URL.

Regards,
Gaurav Aggarwal

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

Yeah, It does do this So I do not understand the bumping (which is against forum rules by the way guys).
What are we missing?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

Cheers Liam - I was unaware of this rule so thanks for letting me know. Oops!

Thanks for the suggestion Gaurav and that is useful - I was unaware of the Category + URL feature.

I can't speak for the other Luke but what I wanted to do was make the blog sit under another page. So on my site I want a page called "Resources" which give a bunch of preliminary info including links to a number of blogs. I really want those blogs to exist as sub-pages of the Resources page, e.g. www.mysite.com/resources/blog1.

I thought that maybe I could do this using a similar technique to web apps, where you set up a folder and create an index.html and then can set the web app URL with the same name as the folder. But the URL field for blogs won't allow the "/" character, so there this no way to make the blog exist anywhere other than as a sub-page of the root, i.e. www.mysite.com/blog1

Does that make sense?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

You would make a web app called resources for that kind of thing Luke.

And then make a folder called the same as the webapp folder and put an index.html page in there. (Yes you can do this)

then you have a landing page under /resources and then all the items that you are looking to do will be /resources/myitemthing

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

LATEST

Luke,

Yes it is possible, I did this for a customer using liquid (module_data) and AJAX.

Here is the liquid, it does 32 posts to a page and has a "load more" button which then loads the next page of 32 blog entries. This blog had separate blog categories you could view or an "all posts". It is ordered via newest first. You will need to change <CATID> and <BLOG ID> to your ID's. Just put this on another page and use jquery to get the data and then inject it into the page.

{% if globals.get.page %}

  {% assign page = globals.get.page | convert: "number" %}

{% else %}

  {% assign page = 1 %}

{% endif %}

{% assign cat = {{globals.get.cat | downcase}} %}

{% assign catid = -1 %}

{% case cat %}

  {% when '<CAT NAME>' %}

  {% assign catid = <CATID> %}

  {% when '<CAT NAME>' %}

  {% assign catid = <CATID> %}

{% endcase %}

{% assign page = page|minus:1 %}

{% assign skip = page|times:32 %}

{% if catid == -1 %}

  {module_data resource="blogposts" version="v3" fields="postTitle,postBody,postUrl" skip="{{ skip }}" limit="32" where="\{'blog.id':'<BLOG ID>','releaseDate':\{'$lt':'{{globals.site.dateNow}}'\}\}" order="-releaseDate" collection="myData"}

{% else %}

  {module_data resource="blogposts" version="v3" fields="postTitle,postBody,postUrl" skip="{{ skip }}" limit="32" where="\{'categories.categoryId':'{{ catid }}', 'blog.id':'<BLOG ID>','releaseDate':\{'$lt':'{{globals.site.dateNow}}'\}\}" order="-releaseDate" collection="myData"}

{% endif %}

{{myData|json}}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines