Need some ideas on pages and posts (nee WP)

doobs
Ssr. Bludit
Posts: 17
Joined: Fri Dec 06, 2024 1:07 am
Has thanked: 1 time

Greetings,

Long time WP blogger looking to migrate over to bludit. I'm still in the evaluation phase.

I tend to do "relatively" short post with links to pages with the full cadre of images.

How might this best be done in Bludit?

I've bumped into a bug in the WP importer plugin, so have only imported 9 pages thusfar.

Initially I had switched them to "static", but that put them in the banner (menu?) in the theme I'm currently trialing (massively) which is decidedly not what I want.

Changing the pages to "default" causes them to be listed in the front page, again, not what I'm looking to do.

How do I define a "page" that doesn't appear in the summary that I can reference from a post?

Thank you
chris
arfa
Master Bludit
Posts: 163
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

Hi Chris,

There is quite a few tangents in your post so I will just deal with the last Q.
How do I define a "page" that doesn't appear in the summary that I can reference from a post?
I am guessing that you want to build pages that are not directly visible - yes?
Have a read of:
viewtopic.php?t=2888
It is a bit tangled but basically - in admin > settings >custom fields you need to set:

Code: Select all

{
    "hidden": {
        "type": "bool",
        "label": "Hidden Page",
        "tip": "Check so page is hidden on the navbar."
    }
}
save this
then edit your page > options > advanced > template ... add: hidden
this is the same as the text in your custom field - it can be anything you want as long as the call is the same for both.

You then set a link on a visible page to your hidden-page URL

I hope this helps.

cheers - Kusalo
doobs
Ssr. Bludit
Posts: 17
Joined: Fri Dec 06, 2024 1:07 am
Has thanked: 1 time

Thank you.

Will investigate.
chris
arfa
Master Bludit
Posts: 163
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

my bad...
You may have picked it up reading through the linked post but perhaps not. Critical. Missed - from my way-back notes...
to be sure that the code is called.
in navbar.php (not sure about theme consistency?)
about #31 = foreach ($staticContent as $staticPage) {
$children = $staticPage->children();
if (!$staticPage->isChild() && $staticPage->template() !== "hidden") {...}
the template needs to be referred. As I mentioned, it can be anything as long as the calls are uniform.

That should do it ?
kusalo
User avatar
indocreativemedia
Ssr. Bludit
Posts: 10
Joined: Sun Sep 24, 2023 5:09 am
Location: Indonesia
Been thanked: 2 times
Contact:

Hi,

Actually, you don't need to create 2 separate posts to achieve what you intended.

You can do that with a single post.

Everytime you create a post, break the introductory short texts and the images with a "Page Break".

The button to insert "Page Break" is on the leftside of the "insert Image" button.

On most themes, this will create a "Continue reading..." link.

So, all texts before the Page Break will be visible on the posts loop, while the rest of the contents are truncated.

Clicking the post title or the continue reading link will open the full content.

So, with this, you don't need to change your posts into static pages.

Just import all of them and then edit the posts by inserting Page Break and then delete the unnecessary posts.

Just an insight. Hope this helps.
doobs
Ssr. Bludit
Posts: 17
Joined: Fri Dec 06, 2024 1:07 am
Has thanked: 1 time

arfa wrote: Wed May 07, 2025 9:04 pm my bad...
You may have picked it up reading through the linked post but perhaps not. Critical. Missed - from my way-back notes...
to be sure that the code is called.
in navbar.php (not sure about theme consistency?)
about #31 = foreach ($staticContent as $staticPage) {
$children = $staticPage->children();
if (!$staticPage->isChild() && $staticPage->template() !== "hidden") {...}
the template needs to be referred. As I mentioned, it can be anything as long as the calls are uniform.

That should do it ?
kusalo
Well,

I was using the theme Massively. There is no navbar.php.

:(
chris
doobs
Ssr. Bludit
Posts: 17
Joined: Fri Dec 06, 2024 1:07 am
Has thanked: 1 time

indocreativemedia wrote: Thu May 08, 2025 8:20 am Hi,

Actually, you don't need to create 2 separate posts to achieve what you intended.

You can do that with a single post.

Everytime you create a post, break the introductory short texts and the images with a "Page Break".

The button to insert "Page Break" is on the leftside of the "insert Image" button.

On most themes, this will create a "Continue reading..." link.

So, all texts before the Page Break will be visible on the posts loop, while the rest of the contents are truncated.

Clicking the post title or the continue reading link will open the full content.

So, with this, you don't need to change your posts into static pages.

Just import all of them and then edit the posts by inserting Page Break and then delete the unnecessary posts.

Just an insight. Hope this helps.
I like the idea

If it only worked as you say.

All it did was stick the photos at the bottom of my post.

Definitely not was I was wanting to achieve.
chris
doobs
Ssr. Bludit
Posts: 17
Joined: Fri Dec 06, 2024 1:07 am
Has thanked: 1 time

arfa wrote: Wed May 07, 2025 9:04 pm my bad...
You may have picked it up reading through the linked post but perhaps not. Critical. Missed - from my way-back notes...
to be sure that the code is called.
in navbar.php (not sure about theme consistency?)
about #31 = foreach ($staticContent as $staticPage) {
$children = $staticPage->children();
if (!$staticPage->isChild() && $staticPage->template() !== "hidden") {...}
the template needs to be referred. As I mentioned, it can be anything as long as the calls are uniform.

That should do it ?
kusalo
Okay,

I really don't understand this. Is the code segment even complete? There is one { but no corresponding }.

I've looked in the referenced thread and that makes even less sense.

Sorry to be a pest.
chris
arfa
Master Bludit
Posts: 163
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

Hey Doobs,
Communication can be a challenge.
Here are my notes from when I first implemented this.
You can also read the documentation:
https://docs.bludit.com/en/content/custom-fields
For static pages NOT to appear on the navbar...

Go to:
admin > general > custom fields
add the following example:

{
"hidden": {
"type": "bool",
"label": "Hidden Page",
"tip": "Check so page is hidden on the navbar."
},
"gallery": {
"type": "bool",
"label": "Page Links",
"tip": "Add link list to gallery pages."
}
}

When creating content... under
options > advanced > template
add the field heading... eg. 'hidden' or 'gallery'

be sure that the code is called. eg.
in navbar.php [this writes both the dropdown menu and prevents hidden pages]
about #31 = foreach ($staticContent as $staticPage) {
$children = $staticPage->children();
if (!$staticPage->isChild() && $staticPage->template() !== "hidden") {...}


To add text or php to a specific page:
eg. in both pages.php and home.php
if ($page->template() == "gallery") { echo 'I can add PHP, build list and add gallery links here'; }
I have left the gallery section in so you can see how more coinditional fields can be added.

I think the only difference is finding the file where your menu is written (navbar.php or according to your theme) and adding the line:

Code: Select all

if (!$staticPage->isChild() && $staticPage->template() !== "hidden") {...}
noting that this creates the conditions for writing the menu for pages that are NOT children and don't have the template 'hidden'. You may need to tweak this according to theme specifics but I hope that the concept is clear?

I hope this helps
Kusalo
arfa
Master Bludit
Posts: 163
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

An interesting turn - of the "live and learn" variety.

The earlier post-thread was me trying to get my head around many things bludit. Am I older and wiser now?

The logic seems quite logical. There is no need to set a custom field. The line (in your menu writing file) still is:

Code: Select all

if (!$staticPage->isChild() && $staticPage->template() !== "hidden")
...and is sufficient. All that is required is to set the template on the page...
new content > options > advanced..
set type as 'static' and template as 'hidden'.

However....
reading the documentation (only now :)) - I see that the conditional statement would better be...

Code: Select all

if ($page->custom('hidden')) { echo 'do not add this to the menu (or whatever)'; }
Either way works but the checkbox is clearly the 'official' method. I will run new projects using this.

I hope this helps- it certainly helped me :)

cheers - Kusalo
Post Reply