Topic: Blog question

Hi, I just posted a similar question over the plug-ins page but ask it here to see if anyone can help.

Please can anybody tell me if there is a to create a template page, which will list blog-posts containing only a certain tag?
   
e.g. the same function as ...but only for posts tagged 'gigs' or 'news' or something?

I see that I could make a menu item and assign it to a URL (e.g http://sitename/blog?tag=gigs), but then when I navigate using the blog's page numbers, it reverts to all of the posts.  A php solution would be great.  Can anyone help?

Thanks!
Mike

Re: Blog question

You paginator does not work on tags page?
so when u ar at page http://sitename/blog?tag=gigs all good right? but then u go to 2nd page of http://sitename/blog?tag=gigs and it showes u ALL blog posts instead of posts from tag "gigs" ?

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Blog question

Hi RomanArt,

Yes that's right.  I can go to http://sitename/blog?tag=gigs and all is fine, but when I navigate to page 2 using the pagination, the URL goes to http://sitename/blog?page=2 (the gig tags has gone).  Does this happen with you?

Ideally I'd really like to know if there is a PHP solution, which can be put into a template - It would mean that the URL's would be much cleaner and that different template pages for different categories.

Thanks for your help!
Mike

Re: Blog question

i report about this "bug" long time ago, no one fixed it just yet smile

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Blog question

Hello, I worked out what my problem was - I was using Aryandhani's excellent Portfolio theme and the blog plug in is modified and I think that part is different.  With the default theme, pagination works.

But - I'm having an idea.  In blog.plugin.php, you can define the $parent_page_name = 'blog'; (line 35).  Can the parent_page_name variable be set to slug of the current page?

Awilum (hello!)  Maybe you can help too?

Thanks everyone! smile

Re: Blog question

Awilum is a bit busy at this moment, will be free asap smile

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Blog question

Thanks very much - I will wait.  In the meantime, do you know what the php syntax is to get the current page's slug?

Re: Blog question

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Blog question

Thanks very much,  I have tried changing (blog.plugin.php) from

$parent_page_name = 'blog';  to
$parent_page_name = Page::slug();

But is not working.  Is this syntax allowed?

Re: Blog question

No its will not work, sorry i tho u ask about different thing

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Blog question

No problem. I've found a workaround for now... it's not very elegant

I haves duplicated and rename the plug-in folder (to 'gigs' in my case) and then also renamed any files inside (eg. blog.plugin.php to gigs.plugin.php and blog.manifest.xml to gigs.manifest.xml), finding and replacing text in any of the .xml and .php files from 'blog' & 'Blog', with 'gigs' & 'gigs'. 

Finally, I made two new templates (gigs.template and gigs-post.template) and edited instances of 'blog' to 'gigs' again...

I now have a blog plug in, but also a separate gigs plug-in which I use for the band's tour dates.  I can style the templates differently too.  I'm sure there's a much easier and better way of doing it though!

Mike

Re: Blog question

Its actually really elegant way smile my website monstrathemes.com made with 4-5 blog plugins smile at, tm, tut, plugs, blog smile

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Blog question

Wow! That's how you are going it too?  I made a lucky guess then. smile It is all working well now... now to find a nice html5 audio player.  Is there one built in to monstra?  Thanks for your help!

Re: Blog question

none is build in smile never needed to use it before, i dont think its a big problem to make one

http://mediaelementjs.com/


i like this one the most
http://kolber.github.io/audiojs/

Browser & format support
With Flash as a fallback, it should work pretty much anywhere.
It has been verified to work across:

    Mobile Safari (iOS 3+)
    Android (2.2+, w/Flash)
    Safari (4+)
    Chrome (7+)
    Firefox (3+, w/ Flash)
    Opera (10+, w/ Flash)
    IE (6, 7, 8, w/ Flash)

(с) Roman Art
So far So good wink

RomanArt's Website

15 (edited by VitiaM 2014-06-22 18:23:11)

Re: Blog question

Thank you very much for this smile
_____________
метални решетки, vrati, пощенски кутии