Page 1 of 2

independent/standalone pages

Posted: Thu Jul 18, 2024 5:18 am
by arfa
Is there some way of using std. page creation, or there might be a plugin, to save a page that can be linked to independently - outside of the std/sttic/static link options?
Or manually creating a file, uploading it and being able to link to it.

Eg. topic specific information that can be presented only from individually set links - and loaded within the bludit environment.

I am looking at this:
https://plugins.bludit.com/plugin/bludi ... text-files
but first trial leaves me wondering just what it does. Is says: "Show static file content at the provided route you desire." but gives no indication as to how to call the file. I have written to the author.

Any suggests?
Thanks

Re: independent/standalone pages

Posted: Thu Jul 18, 2024 7:47 pm
by Edi
I do not undestand your question... Do you mean the navigation settings?

Re: independent/standalone pages

Posted: Thu Jul 18, 2024 10:20 pm
by arfa
Sorry about the language. And, thank you for reading.

I want to have access to data, in a file, stored locally (online) that is accessible, can be loaded in the main environment [this looks like [div class="col-md-9"] , via a page link but that file data is not displayed - either by default on the main page listings or on the static page menu.

eg: a sample: normal page text:
This is all about this topic and here is some sample text with further detail [link to test.txt]available here[/link] which I am sure you will find interesting. blah blah...

Where test.txt is in a folder; at this stage probably created manually but I am thinking of a plugin. I am sure it can be done, just a matter of how/where to start. I am moderate coder but bludit is relatively new so I am still getting my bearings.

I hope this makes more sense?

Have a good day.
Kusalo

Re: independent/standalone pages

Posted: Sun Jul 21, 2024 5:39 pm
by Jay
If you want to have static pages available to be edited with bludit, and not automatically displayed anywhere on your website, your only problem to solve lay in functions responsible for displaying links to static pages, like menu functions.

Either create your own function for listing static pages with exceptions if you want a dynamically created lists with links, or if you have couple static pages you can skip automatic menu generation and just hardcode menu in template file.

For automatically generated menus you'd base on exceptions not to show such pages. I'd try with assigning all "hidden" pages a specific template name or just base on page's properties like robots in seo options.
https:/nietak.de
as for the plugin you mentioned in first post, I assume it's about uploading static pages under own directory in your website that will add exception to bludit's routing functions.

Re: independent/standalone pages

Posted: Sun Jul 21, 2024 8:49 pm
by arfa
@jay - many thanks for your thoughts. I have not quite got to the menu generation part but here is my first fix for not displaying pages. From my 'notes to self':
NB - using theme blogx...

TO CREATE HIDDEN FILES - using static pages
create a new page, set it as static before saving
set the title with a leading '_' eg. _A Test
this will create a normal page folder 'a-test'
to stop the page being added to the navbar
replace the equivalent install code in blogx/php/navbar.php

Code: Select all

<!-- Static pages -->
<?php foreach ($staticContent as $staticPage):
if (substr($staticPage->title(),0,1) !== '_') { 
echo '<li class="nav-item">
<a class="nav-link" style="color:#FFF;" href="'.$staticPage->permalink()
.'">'.$staticPage->title().'</a></li>'; 
} ?>
<?php endforeach ?>
to display the page without the '_' in the title add code in bl-themes/blogx/php/page.php
replace the equivalent install code with:

Code: Select all

<!-- Title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2 class="title">
<?php
if (substr($page->title(),0,1) == '_') { $pageTitle = str_replace('_','',$page->title()); }
else { $pageTitle = $page->title(); }
//echo $page->title();
echo $pageTitle;
?>
</h2>
</a>
I will now be looking at having a menu in a template page. I am still learning the bludit layout and... docs (bludit.com) still down so I will wait on that one. Unless anyone has some basic guidance on inserting a menu builder. I have a really simple 30 line php that I use but am happy to have suggestions.

thanks - Kusalo

Re: independent/standalone pages

Posted: Sun Jul 21, 2024 9:49 pm
by Jay
you quite overcomplicate the workflow
I'd go the simplest way possible, create a static page, and use one of its options field.
Lets insert a "hidden" string in pages options->advanced->template field, so that we won't include such pages in generated menu.

For blogx template we only need to add 2 lines of code to generate the menu excluding "hidden" pages.

Code: Select all

<div class="nav" id="navbarResponsive">
<ul class="">
<?php foreach ($staticContent as $staticPage): ?>
<?php if ($staticPage->template() !== "hidden") : ?>
<li class="nav-item">
	<a class="nav-link" href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
</li>
<?php endif; ?>
<?php endforeach ?>
</ul>
</div>
You could also base on tag input field or have a category for hidden pages, but you'd also have to edit functions for displaying tags or categories to add exceptions for the hidden pages. Assuming that you would want to hide the tag/category for hidden pages.

Re: independent/standalone pages

Posted: Sun Jul 21, 2024 11:55 pm
by arfa
I really appreciate the follow up Jay but need a bit more clarification - I am the newbie here :) - and I do like simple.

>> insert a "hidden" string...
I am not sure what this means. I am sure it will be obvious if you could give me an example please?

The navbar code is clear enough - just not sure how to get the 'hidden' bit embedded.

Thanks - Kusalo

Re: independent/standalone pages

Posted: Mon Jul 22, 2024 8:25 pm
by SpegalDev
I think Jay was talking about adding a custom field. You can do so in /admin/settings:

Code: Select all

{
    "hidden": {
        "type": "bool",
        "label": "Hidden Page",
        "tip": "Check if the article should be hidden in navigation."
    }
}
Then, when you're creating a new article, go to Options -> Custom -> check "Hidden Page"

Then, in your navigation, you just need to check and see if the page has that option enabled.

Re: independent/standalone pages

Posted: Mon Jul 22, 2024 10:20 pm
by arfa
Thanks Segal.

admin > settings/general > custom fields.
It would be useful for newbs if there was whitespace between the [] - to make it obvious [ ]

In my first attemt (in haste?) I deleted that.
Added the code - save >
new content > options > custom fields ... and there is the checkbox. I check it - save
but the page is on the navbar

Do it with the brackets and there is no checkbox.

I see the code in databases/site.php and that seems fine.
Check Jay's code in navbar.php = OK

What am I missing here?

thanks - k

Re: independent/standalone pages

Posted: Tue Jul 23, 2024 5:17 am
by arfa
PS - I just tried this with a fresh install and the result is the same
With [ ] = no checkbox
without [ ] = checkbox but the link is on the navbar.

thx - k