Hello,
I'm not sure if this has been answered already and I've searched the forums but may have missed it. I've created the Blog folder and blog slug but my memory needs refreshing.
I need advisement with:
a) creating the actual page where the blog posts will appear
b) the link in the footer to the blog page where the posts will appear
Please share how you've done it. Thanks in advance.
How to link to blog posts using Info Pages?
- burt
- Core Team
- Posts: 4561
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 422 times
Re: How to link to blog posts using Info Pages?
Simplest;
where x is the ID of one of your blog posts.
Maybe a box? Maybe a footer? Maybe a navbar dropdown?
--
Or you can of course go more complicated and make a new blog.php page which shows only the info_pages in your blog folder. Update the canonical header tag module appropriately. And so on.
Is already existing; info.php?pages_id=x
where x is the ID of one of your blog posts.
All you need is some module made to list the pages that are in your "blog" folder.b) the link in the footer to the blog page where the posts will appear
Maybe a box? Maybe a footer? Maybe a navbar dropdown?
--
Or you can of course go more complicated and make a new blog.php page which shows only the info_pages in your blog folder. Update the canonical header tag module appropriately. And so on.
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to link to blog posts using Info Pages?
What is the perfect model to use to create a module to list the pages that are in the blog folder? Thanks for the quick reply.burt wrote: ↑Tue Oct 24, 2023 11:32 pm Simplest;
Is already existing; info.php?pages_id=x
where x is the ID of one of your blog posts.
All you need is some module made to list the pages that are in your "blog" folder.b) the link in the footer to the blog page where the posts will appear
Maybe a box? Maybe a footer? Maybe a navbar dropdown?
--
Or you can of course go more complicated and make a new blog.php page which shows only the info_pages in your blog folder. Update the canonical header tag module appropriately. And so on.
- burt
- Core Team
- Posts: 4561
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 422 times
Re: How to link to blog posts using Info Pages?
I'm not sure what you're asking...
Options include all those I previously mentioned as well as any others you can think of (eg a PI module for index).
Options include all those I previously mentioned as well as any others you can think of (eg a PI module for index).
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to link to blog posts using Info Pages?
I'm sorry. I guess I meant the page that will list the blog topics. Is there anything available that can be used as a model to build, for example, blog php? Or will any of those you've mentioned need to be built from scratch?
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to link to blog posts using Info Pages?
Thanks. I'll give it a go soon. I can see how it can be used as a blog.
What Phoenix versions has this been tested on?
- burt
- Core Team
- Posts: 4561
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 422 times
Re: How to link to blog posts using Info Pages?
I'm still a bit hazy on what you're wanting to achieve. It sounds like you want to use the info_pages system to run a Blog? Those blog posts would be viewable in the shop side on info.php
You therefore just need a module built (I've listed a few ways in previous posts in this thread) which shows a list of recent "blog" posts linked to (eg) info.php?pages_id=4 or whatever. This list of links would be done using the Container system - example [ https://github.com/CE-PhoenixCart/Phoen ... hp#L14-L20 ] something like;
Which says...make a container that holds;
pages in the blog folder
english
published
The container system appears more complicated than it really is. All it really dies is allow shopowner to write SQL without actually writing SQL.
Once you have a container of $pages, outputting them (in the module template file) is very easy;
Obviously add in bootstrap HTML to make it pretty, etc
--
As I already mentioned, you might want to split out the blog posts into their own "blog.php" page. It would need to custom coded. The general idea would be to have a blog.php page which lists "X" number of your recent blog posts, maybe an excerpt of each [same idea as above, container] - with a "read more" link. The read more link would link to the full blog post; blog.php?id=4 which would show the full content of blog post.
You therefore just need a module built (I've listed a few ways in previous posts in this thread) which shows a list of recent "blog" posts linked to (eg) info.php?pages_id=4 or whatever. This list of links would be done using the Container system - example [ https://github.com/CE-PhoenixCart/Phoen ... hp#L14-L20 ] something like;
Code: Select all
$pages = info_pages::getContainer(['pd.languages_id' => '1', 'p.folder' => 'blog', 'p.pages_status' => '1']);pages in the blog folder
english
published
The container system appears more complicated than it really is. All it really dies is allow shopowner to write SQL without actually writing SQL.
Once you have a container of $pages, outputting them (in the module template file) is very easy;
Code: Select all
foreach ($pages as $k => $v) {
echo $v['pages_title']; // outputs the title
}--
As I already mentioned, you might want to split out the blog posts into their own "blog.php" page. It would need to custom coded. The general idea would be to have a blog.php page which lists "X" number of your recent blog posts, maybe an excerpt of each [same idea as above, container] - with a "read more" link. The read more link would link to the full blog post; blog.php?id=4 which would show the full content of blog post.
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to link to blog posts using Info Pages?
That's what I'm thinking about. I didn't know how to articulate it well. Thanksburt wrote: ↑Thu Oct 26, 2023 9:40 am I'm still a bit hazy on what you're wanting to achieve. It sounds like you want to use the info_pages system to run a Blog? Those blog posts would be viewable in the shop side on info.php
You therefore just need a module built (I've listed a few ways in previous posts in this thread) which shows a list of recent "blog" posts linked to (eg) info.php?pages_id=4 or whatever. This list of links would be done using the Container system - example [ https://github.com/CE-PhoenixCart/Phoen ... hp#L14-L20 ] something like;
Which says...make a container that holds;Code: Select all
$pages = info_pages::getContainer(['pd.languages_id' => '1', 'p.folder' => 'blog', 'p.pages_status' => '1']);
pages in the blog folder
english
published
The container system appears more complicated than it really is. All it really dies is allow shopowner to write SQL without actually writing SQL.
Once you have a container of $pages, outputting them (in the module template file) is very easy;
Obviously add in bootstrap HTML to make it pretty, etcCode: Select all
foreach ($pages as $k => $v) { echo $v['pages_title']; // outputs the title }
--
As I already mentioned, you might want to split out the blog posts into their own "blog.php" page. It would need to custom coded. The general idea would be to have a blog.php page which lists "X" number of your recent blog posts, maybe an excerpt of each [same idea as above, container] - with a "read more" link. The read more link would link to the full blog post; blog.php?id=4 which would show the full content of blog post.