$this->author() on article
|
14 posts
|
hi, i’ve recently set up Frog on my website, and made a new layout to it… which is working fine and all, but i want to have the article display the author’s username on the page.
i have achieved this on the parent page, “articles”, where it searches for the 5 latest news articles and lists them with their author, date created, and have wrote the layout to change if it does not have a side bar, as the article pages are the only ones without on my site. |
|
257 posts
|
Seems strange. I can get it to work as in this example:
See this specific example at the hiddeninplainview site |
|
14 posts
|
so using
and a foreach loop makes $article refer to the current article? |
|
257 posts
|
Yeah seems to work ok in that form… |
|
14 posts
|
well, now my code says
but it doesn’t echo anything at all! |
|
1493 posts
|
So if Does Frog know where to find the
And cross your fingers. :) Might work … might not… One lives in hope. Update: I just noticed you have |
|
14 posts
|
er… what i was tryng to achieve was: |
|
1493 posts
|
Ah, o.k. So not a list of recent articles, but just the “meta” for the current article? I think all you need for that, is to put this in the
Does that do it?? |
|
14 posts
|
that works, except it doesnt show the author for some reason… |
|
316 posts
|
What version are you using Cpt-Jim? |
|
1493 posts
|
Huh? (You edited that, didn’t you! Confess! :) Just in case — in the backend, when you’re editing a page you’ll get a line underneath the editing area something like:
Could you check and ensure that you’re getting a name there? |
|
316 posts
|
I had the same problem when I was using 0.9.3, but it was fixed in 0.9.4 and I had to revert back to $this->author(). If you are using 0.9.3, I think I can find my solution in one of my old backup files. EDIT: I found the backup. When I was using 0.9.3, I was using:
to display the author’s name. In 0.9.4, though, that line no longer works and I had to revert back to:
Hope that works. |
|
14 posts
|
@david – yeah, sorry… wrote it and then changed my mind… my bad. but i am getting that line, it says
(as it should) |
|
316 posts
|
I’d upgrade. Just upload the new files to your server, then disable and re-enable your comment plugin. You’ll also need to run an INSERT on your database to insert the following values into your frog.settings table:
That’s it, you’ll be up to date with 0.9.4. I’m very happy with the changes from 0.9.3. I highly recommend the update. |
|
1493 posts
|
Well, there’s a poser and no mistake. I never noticed this before, I suppose since things like Way back a number of versions ago, Philippe used to include a list of what things you could call where. I don’t know if that would have signalled this issue, or not! Meanwhile mtylerb’s right – 0.9.4 is the way to go! (Be sure to read the “updating.txt” file in the Frog root dir, too, in addition to mtylerb’s instructions :) |
|
14 posts
|
thanks for your help, upgrading seems easy, so i’ll be on my way :) |