Problem when establishing homepage

User avatar
tonimad
Ssr. Bludit
Posts: 16
Joined: Wed Dec 23, 2015 8:34 am

Hello,

Problem scenario:

- I have 10 post and 5 pages.
- In Advanced Settings, I set one of my pages as the homepage.

The problem:

If I follow the above steps, then my system displays the page that I have chosen as the home page. So far, everything is correct. However, setting this option, I no longer have access to any of the post. None of the post does not appear on any page.

How can I see now my post?
Any suggestions?

Thank you very much!
User avatar
Fred
Legend Bludit
Posts: 236
Joined: Wed Jun 24, 2015 2:14 pm
Location: France
Contact:

Hi Tonimad,

This problem has already been mentioned, for now it's either you use Bludit as cms or pages + posts (defaut config)
╰☆╮Bludit╰☆╮ is a open source and community contributions are essential to project success!
You are looking for a light forum based Json? Try my project Flatboard, it is free. ;)
Sorry for my little english, i'm french :oops:
User avatar
tonimad
Ssr. Bludit
Posts: 16
Joined: Wed Dec 23, 2015 8:34 am

Hi Fred,

Thank you very much for your reply.

I was reviewing the forum but found no mention of this problem. Maybe I did not look well, sorry.

Is there a ready solution in the next update? And on the next update, is there a expected date? Thank you.
MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Hi Fred,
I asked the same question a couple of months ago in the gitter chat, you could join us on https://gitter.im/dignajar/bludit.
Some of us are on #bludit on freenode too, even though there's no dev in there.
User avatar
tonimad
Ssr. Bludit
Posts: 16
Joined: Wed Dec 23, 2015 8:34 am

Hi MaurizioB,

I have read the chat conversation. In my opinion, a plugin is the best solution. I agree with the comment of user "clickwork-git";
Perhaps it's possible with a plugin. It should be very easy and not so confusing as for example in WordPress.
User avatar
Fred
Legend Bludit
Posts: 236
Joined: Wed Jun 24, 2015 2:14 pm
Location: France
Contact:

In fact it is myself who had mentioned this 'problem' forum at the beginning (sorry I can not find either the discussion).

I do not see why this should be integrated plugin in that case why not prososer the blog plugin too?

Bludit provides an option to display a page as a page option, you can also configure the URL to posts and pages.

Logic and to define a name for a link to the blog section.

It remains my opinion but as proposed like that, it looks like Bludit and still in Beta stage.

A brief talk with Diego what think of it, but for now spend a good holiday season;)
╰☆╮Bludit╰☆╮ is a open source and community contributions are essential to project success!
You are looking for a light forum based Json? Try my project Flatboard, it is free. ;)
Sorry for my little english, i'm french :oops:
User avatar
tonimad
Ssr. Bludit
Posts: 16
Joined: Wed Dec 23, 2015 8:34 am

Hi Fred,

Thank you for considering this problem.

I've been reviewing the code and can not find a clever way to display a page that shows all post.

I hope this has any solution.

Again, thank you very much and happy holiday season!
MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Ok, in the meantime I've "hacked" it.
I created a fake "Blog" page (the content is not important, obviously), then I edited the index.php in the theme folder.
In the <!-- Content --> section of the index.php there's a condition blok that looks for the type of page and then includes various php files accordingly, so I created a sub condition in the elseif($Url->whereAmI()=='page') block which looks for the page title, if it's "Blog", then it uses the home.php file, otherwise proceeds with the usual page.php file.

This is the original section:

Code: Select all

	            if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') )
	            {
	                include(PATH_THEME_PHP.'home.php');
	            }
	            elseif($Url->whereAmI()=='post')
	            {
	                include(PATH_THEME_PHP.'post.php');
	            }
	            elseif($Url->whereAmI()=='page')
	            {
	                include(PATH_THEME_PHP.'page.php');
	            }
This is how I edited it (modifications in bold):

Code: Select all

	            if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') )
	            {
	                include(PATH_THEME_PHP.'home.php');
	            }
	            elseif($Url->whereAmI()=='post')
	            {
	                include(PATH_THEME_PHP.'post.php');
	            }
	            elseif($Url->whereAmI()=='page')
// Edited code here!
	            {
                        if ($Page->title()=='Blog')
                        {
                            include(PATH_THEME_PHP.'home.php');
                        }
                        else
                        {
                            include(PATH_THEME_PHP.'page.php');
                        }
	            }
If you want you can change the Blog name to whatever you want, it just has to match the condition in the $Page->title() condition.
I know this is not very "clean", but this is as much as my php knowledge might attempt without messing too much with the code ;)

Hope this helps!

Cheers!
User avatar
tonimad
Ssr. Bludit
Posts: 16
Joined: Wed Dec 23, 2015 8:34 am

Hi MaurizioB,

Your code is perfect and works great for my site. It is a very good solution.

Thank you very much for your time and effort.

Happy holiday! :)
MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Don't mention it, I was looking for the same thing too, glad it helped somebody else too! :D
Actually, I think this solution would eventually be the best one, even better than a plugin: if the main bludit kernel adds the support for a "blog" system page (like the ones already exist, such "post" or "page"), then it would be easy to add other kind of pages.
For example, when creating a page you could set a "special" pages such like this blog index, and a "redirect" page for anything else such a page outside the CMS content or an url outside of the website.

Happy holidays to you too!

MaurizioB
Post Reply