Using the blog app with runway
Hi
Can you create an article on how to use the blog app in runway. I ask because i am having trouble getting the clean URL that you get in Perch by using the clean url (https://docs.grabaperch.com/addons/blog/installation/clean-urls/) doco. and by changing the Blog post page path.
In perch Runway, It does not seem to matter what URI segment i add blog/[isodat]-{slug} in runway as soon as you change the Blog post path, nothing works.
I have noticed that you also now need to have /blog/post.php in the path field. so you end up with /blog/post.php?s=2014-10-27-my-first-blog as that is what the slug format is in settings.
I am really confused and I think it would help with routing in general to understand this.
Regards,
Brett
When you say nothing works - what happens?
if i leave everything as it i, the blog app works, but you get
/blog/post.php?s=2014-10-27-my-first-blog
,how do i get rid of he
post.php?=
and replace it with
/blog/2014-10-27-my-first-blog
.in perch you would add
RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]
to achieve this, I have tried
blog/[isodat]-{slug}
but it seems tied to the Blog post path.Can you list the steps to
/blog/2014-10-27-my-first-blog
You don't need to add any rewrite rules - just add a route in the page details.
Hi Drew
I installed a clean version of runway, install the blog app and moved it into templates/pages. added the new blog, post and archive pages and selected the master page. added a post and it works but has the full /blog/post.php?s=.
It makes no difference what route you add to the page, the blog app is controlled by the settings page and the blog path and slug. If you dont add post.php?s={postTitle} you get the error page
As all the templates are looking for the get(s) , can you have a look and see what can be done to get clean URL in the blog app, i assume the events app will be the same.
If you think i am not doing something correct can you please let me know.
Regards,
Brett Regards,
Brett
perch_get()
will retrieve either$_GET
in PHP parlance)Yeah I seem to be having troubles as well. It only works when you do post.php?s={postTitle} I must be missing something.
Hi Drew
so are you saying that the default post.php page needs to be rewritten
becomes
or do we need to rewite them with
https://docs.grabaperch.com/runway/routing/named-segments/ but change the custom part to blog.
Regards,
Brett
No, I'm not saying that.
Have you set up a page route for your post page? What does it look like?
Should be something like
I think the confusion is because Blog is an app, and those files live in a blog folder vs pages.
Can you put the blog/post.php file in the pages folder in runway? If so how do you tell runway that the blog app posts are being referenced from the router and not the actual blog directory?
Hi Brandon
You need to put the entire blog folder into pages, you then need to create the three pages in runway, index. post and archive, If you want clean URL,s you need to change the Blog post page path in settings to /blog/{postSlug}
then in the post.php page you need to add blog/[slug:s] to the URL pattern
the archive page will still have /blog/archive.php so its the last thing i need help with from Drew or Rachel
Hi again Drew
how do you get the archive page to not have the .php in the archive page you have the path = /blog/archive.php
in the URL pattern i add / blog/archive
this list all of the tags and categories but not the posts, you need to have /blog/archive.php to list the post
what URL pattern do i need and in my templates do i just add
Where is the link to
archive.php
being created? I would have thought it's just in the templates.The blog app has index, post and archive. It is in the template, post-in-list. I want a link to older news.
Ok. I'm not sure I understand the problem.
I think if you answer my other post I will be able to sort this out.
I can't see any other unanswered posts from you. What's the URL?
Thank Brett this worked like a charm.
Hi Drew
The only issue now is how do we change all of the archive.php url,s
so you will have /blog/archive.php?cat= and /blog/archive.php?tag= and /blog/archive.php?year=&month=
do you add multiple url patterns
Sure, something like