How do I move my posts to a new page?

Hello,

I created a new Navigation item and then went on to create a new Page, with the purpose of moving all the posts to this newly created Page.
As you might know, all posts are stored on the Home Page (i’m using Atilla theme).
I did successfully create a new Page, but this it was not what I envisioned it to be - it is simply a new Post, not a new Page.
Indeed, when I hit New Page button, I am always asked to provide a Title and then “begin writing your page…”:

I don’t need to write a Page - I’d rather write a Post in the newly created Page.

I thought I already created a new page by creating a new Navigation Item and linking its URL to the new Page.

Please advise how could I start populating my Posts in the new Page?

1 Like

I am curious about this too. Let me know if you find out this information on your own. Hopefully someone will reply with a good answer.

Hi Paxas, hopefully this helps.

First, my understanding of what you want to do is to have a new (different from your homepage) section of your website that all or some of your posts appear on instead of your home page.

Ghost’s definition (and intended function of) posts vs pages is listed here.

The especially relevant portion there is their statement that: “Pages are generally used for static one-off content, and are excluded from all feeds.” Examples of pages are a privacy policy, or an ‘About this site’ section.

Since a page is a intended for “static one-off content,” it won’t easily do what you are looking for.

However, I believe that what you are looking for can be implemented in with tags, and some modifications to the Atilla theme on your page.

  1. Every post that you want to show up on a new ‘page’ can be tagged with the same external tag (MyNewPage)
  2. Every post that you want to show up on a new ‘page’ can be tagged with the same internal tag (tags that start with #, and are not visible to users of your site, for example: #DontShowOnHome)
  3. You can modify your theme to exclude all posts with the #DontShowOnHome internal tag from your home page
  4. You can create a new primary navigation menu item that points to the external tag you identified in step 1.

This is what I have done on my site. You can see it here https://twelvetables.blog/. I put out a weekly newsletter that I don’t want to clog up my home page, so I have used the WYSK external tag to create a new section of my site that hosts my WYSK articles, but keeps them off my home page.

Does that provide the functionality you are looking for?

2 Likes

hi @twelvetables

Thank you for your advice, I think I’m a bit closer to the solution now.

The problem that remains is that I cannot move all the tagged Posts to a single Page.

My website navigation has only two items - “Home” and “Stories”:

So I created an internal tag “#stories” and then went on and added this tag to one of my Posts:

image

It went well - this tagged Post ended up under “localhost:2368/stories/” as expected.

But when I try to tag another Post with the same tag “#stories”, I am not allowed to redirect it to “localhost:2368/stories/” - Ghost automatically changes the URL to “localhost:2368/stories-2/”:

image

Obviously, I don’t want this Post to be moved to “localhost:2368/stories-2/” because my website does not have a navigation item called “Stories-2” - how are the website visitors supposed to find this Post?

I see in your blog you use “/tag/wysk/” slug but I’m not quite sure how did you map all your “#wysk”-tagged Posts under it?

EDIT: OK, I re-read your post and realized that I haven’t created an External Tag. Will try to do this and see how it goes

yeah, it works now with the External Tag.

Now I have to learn Handlebars just to be able to exclude Posts from the Home Page.

I will never understand why Ghost doesn’t offer its users to redirect the Posts to ANY Page they want directly in the Admin Panel.

btw @twelvetables, I tried to sign up to your blog (around 15 min ago) and I haven’t received any email verification message to my GMail account (checked the Spam folder too).

If I understand you correctly (and i might not :sweat_smile:), I think what you want to be doing is using dynamic routing. So if you want a so-called “page” with just posts with the tag of Stories then it’s much easier than you think.

Basically you update the routes.yaml file to fit your needs to dynamically route the tagged posts to the pages you’d like: For example, in this instance i get my posted with the tag “blog” to go to the blog “page”. (And i put page in quotes because it’s not really a page, if that makes any sense)

routes:

collections:
  /:
    permalink: /{slug}/
    template: index
    filter: tag:-blog

  /blog/:
    permalink: /blog/{slug}/
    template: blog
    filter: tag:blog

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

You can find more information here on dynamic routing: >>

2 Likes

Hey, thanks!
Hmm… can you try again? I checked my mailgun account and it attempted to send an email to your gmail account, but it looks like gmail sent an error of “The email account that you tried to reach does not exist.” I’ll DM you the email address that mailgun tried to send to for you, hopefully it is just a typo.
I can see in my ghost logs where ghost tried to send you the magic link, and just tried to signup with a dummy account and everything worked.

Let me dig through my config and see if I can find the handlebars tweaks I made and I’ll share it here. It was simple once I figured out where to put the change.

Hahaha this is a cleaner solution than what I cooked up. Thanks for sharing.

1 Like

yeah :slight_smile: once you get the hang of it it is’ really quite elegant. But not intuitive at first.

1 Like

Ok, so @brendantko has a better solution here with routes, but just to close the loop I’ll share my dirty solution:
Go into your Ghost admin page, and then go to Settings, and then Themes.
Download the Casper theme.
Unzip the folder, and open up the index.hbs file. By default it will end with:

{{!-- The main content area --}}
<main id="site-main" class="site-main outer">
    <div class="inner posts">

        <div class="post-feed">
            {{#foreach posts}}

                {{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
                {{> "post-card"}}

            {{/foreach}}
        </div>

    </div>
</main>

Modify that to read:

{{!-- The main content area --}}
<main id="site-main" class="site-main outer">
    <div class="inner posts">

        <div class="post-feed">

            {{#foreach posts}}
{{!-- The line below is added to remove internal 'DontShowOnHome' tag from the main page --}}
            {{^has tag="#DontShowOnHome"}}
                {{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
                {{> "post-card"}}
            {{/has}}
            {{!-- The line above closes the section removing 'DontShowOnHome' from the main page --}}
            {{/foreach}}

        </div>

    </div>
</main>

Then zip everything back up and upload it as a new theme and activate it.

But again, using routes is a much more elegant solution.

1 Like

hi @brendantko, thanks for the tip!

Unfortunately I cannot modify “routes.yaml” from Ghost Admin (I’m using GhostPro, which means that the Ghost itself is running on a server which is not managed by me - I can only modify themes on my local machine)

I actually managed to filter out all my posts from the Homepage by simply commenting out one line in the Attila theme’s index.hbs file:

<div id="index" class="container">

	<main class="content" role="main">

		{{!--> "loop"--}}
			
	</main>

I’m not sure whether I should call my solution “elegant” or “clumsy” but it works so far :laughing: :laughing:

Hmmm you can’t?

You don’t have the Labs area in your admin settings? I would have thought it’d be standard in Ghost PRO too… but I could be wrong. Should look like this:

Click on LABS and then you’ll see this at the bottom >>