Open a blog post for public when a site visitor clicks a "Read More" link on frontpage?

Open a blog post for public when a site visitor clicks a "Read More" link on frontpage?

by Zarah Khan -
Number of replies: 5

I have created a blog post and I have displayed a part of it (that is first sentence from the start of the blog post) on the front page. After that, there is a "Read More" link. What I want is that any person who visits the site should be able to click on the link and read the full article displayed on a separate web page. 

The ugly master


PROBLEM:

 In order to provide a link on the frontpage, I am using the `<a>` tag and for the value of `href` attribute, I right clicked on the `Permalink` (bordered red in the screenshot) and copied the link address. The value was "http://localhost/moodle/blog/index.php?entryid=3". 

Now this does not open for people who are not logged in (and rather redirects to `login/index.php` page)

So what should I do so anyone visiting the site can read the blog post by clicking on the `Read More` link displayed on the front page.


A SOLUTION I AM THINKING OF:


As I am already reading the blog post from the database to display its first sentence on the frontpage, should I store the entire blog post as a string and send it to a new page (I create) via `POST` or something, and display it on that newly created page. I am afraid creating a completely new page will pose a security risk?

Note: It is only about one (latest) post I want to link to from the front page.

Average of ratings: -
In reply to Zarah Khan

Re: Open a blog post for public when a site visitor clicks a "Read More" link on frontpage?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Is 'guest access' turned on for the course the blog resides in?

In reply to Zarah Khan

Re: Open a blog post for public when a site visitor clicks a "Read More" link on frontpage?

by Matt Bury -
Picture of Plugin developers

Hi Zarah,

Moodle's big, heavy software and not really designed for public blogging. You'll be using a lot of server resources for something that specialist blogging software can do much better and more efficiently.

Have you considered using a dedicated blog for public blog articles rather than Moodle? If you don't want to or can't install a blogging app on your server, you can set up one for free on Wordpress.com, Blogger.com, or any blogging service that supports RSS feeds. Then in Moodle, you can subscribe to the blog and get an automatic feed that you can display on Moodle's front page.

How does that sound?

Average of ratings: Useful (1)
In reply to Matt Bury

Re: Open a blog post for public when a site visitor clicks a "Read More" link on frontpage?

by Zarah Khan -

That's sounds great if that can be done easily. I'll just start looking for some tutorial on how to do that. Thank you so very much.

In reply to Matt Bury

Re: Open a blog post for public when a site visitor clicks a "Read More" link on frontpage?

by Zarah Khan -

Hello Mr. Matt Bury,

I got side-tracked, but I am back to working on it. I want to integrate a WordPress blog with Moodle website. I want to show an excerpt from a few latest blog-posts on the website's front page.

I did a web search, but could not get a clear picture of how to go about it, so I posted a question here. Can you have a look if you have some time? I will appreciate it.

Thank you.