Forum

Thread tagged as: Problem, Runway, Blog

Multiple blogs different directory levels

I have multiple (2) blogs setup in runway /blog and /autism/autism-news I am using different templates and displaying the post_in_list bit fine for the two blogs.

I have added:

/{blogSlug}/{postSlug}

to the settings - Blog post page path and that is not quite working for the autism news blog.

I am getting domain/blog/slug as I require for the blog blog, but getting domain/autism-news/slug when I require domain/autism/autism-news/slug in the other autism news blog.

Is there any way around this or do I have to rethink my directory structure to bring them both to the same levels?

Greg Riley

Greg Riley 1 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Greg,

Perch is outputting the post URL based on the path you've set in the Settings. So if your blog slug is autism-news, then <perch:blog id="postURL" /> is outputting exactly what you would expect based on /{blogSlug}/{postSlug}.

You can modify the template to prefix the URL with /autism:

<a href="/autism<perch:blog id="postURL" />">
<perch:blog id="postTitle" />
</a>

You can also piece your post URLs yourself if you prefer:

<a href="/autism/<perch:blog id="blogSlug" />/<perch:blog id="postSlug" />">
<perch:blog id="postTitle" />
</a>

Fantastic thanks for the great help. I went with your second option of making the post URL. I tried the first option but it was outputting the path as /autism/..autism-news/slug