On my frontpage i only show articles. But i would like to add some php-code between article one and two. In wich file, and where can i add my code? :)
Andreas
make an article with that code then pin it
How do i pin an article to always be number two?
have article 1 pinned, and article 2 set to a less recent date then the middle article
so the article u want in the middle is set to the future
That sounds kind a "stupid" :), i want my articles to have their appropriate date, and it makes you have to unpin the old and pin a new article every time you write a new one to make it come out on top.
Can anyone point me to where in the source I have to add my own code in such a way that it comes between article one and two? :)
Best Regards
Andreas
sorry if it sounds stupid to you as it did to me aswell
but this the reply I get.............
(note its from Aug, so just imagine how many and often I have to edit articles)
Quote from: Bloc on August 06, 2006, 11:48:08 AM
I see the point though..to make the others appear high up. But with the day/month and present year timespace it should be quite possible to shuffle around.
I have however looked at making articles "sticky" - as in appear AFTER featured (this HAS to be just one article since its tied up against frontpage- show single article option) - sorted on date there as well. So you essentially could sticky thsoe you want high up and just set dates for the positions between them.
I think that will be more versatile in terms of having more than one "featured" article. Its essentially sticky + one super sticky lol. :)
Uhum? So this is like impossible?
i wouldnt say impossible.......... if Tom Cruise can complete a mission
Mayby some hardcore coder, can enlighten us? :)
A
You could put your featured article into a frontpage article block, followed by your php block (also a front page block) and then follow that other article blocks for the others you want to include. You would change your settings so that you would only show Front Page Blocks on the front page. At that point, you would have complete control over the order that your articles and php appear in.
Yeah, I know that`s one way to solve it, but then i have to reorganize my frontpage every time i write a new article.
Is it reallly impossible to add code where i want? (its a recent topics thingy) :)
Regards A
It's probably not impossible, but Bloc has said that he is considering making another "sticky" article in a future version, so you could wait for that.
I haven't investigated the innards of all of the code to know where it even prints out the articles.
It's not hard to insert a new block wherever you want to insert it. You only have to change one number to put a block any place you want to in the list.
Quote from: JPDeni on November 02, 2006, 05:41:20 PM
It's probably not impossible, but Bloc has said that he is considering making another "sticky" article in a future version, so you could wait for that.
I haven't investigated the innards of all of the code to know where it even prints out the articles.
It's not hard to insert a new block wherever you want to insert it. You only have to change one number to put a block any place you want to in the list.
I dont use center blocks on my front page, i just show the last 10 articles. And don`t pin any of them.
So, if i should create 10 blocks on my frontpage, and have the mots recent article show up above my recent topics code i will have to move all my articles down one notch. by selecting one and one for each center block.
Or am i not thinking right?
A :)
QuoteOr am i not thinking right?
Bingo!! :)
If you have blocks, you have something that looks like this:
| Pos | Title |
| 0 | Article1 |
| 10 | Article2 |
| 20 | Article3 |
| 30 | Article4 |
Yes?
So now you want to add Article 5 to the top of the list. It ends up like:
| Pos | Title |
| 0 | Article1 |
| 10 | Article5 |
| 20 | Article2 |
| 30 | Article3 |
| 40 | Article4 |
It always seems to add a new article in the second position. You'd have to change two numbers, I guess, to get it to sort right.
| Pos | Title |
| 10 | Article1 |
| 0 | Article5 |
| 20 | Article2 |
| 30 | Article3 |
| 40 | Article4 |
and hit the Send button, which makes your list end up to be
| Pos | Title |
| 0 | Article5 |
| 10 | Article1 |
| 20 | Article2 |
| 30 | Article3 |
| 40 | Article4 |
Let's say you decide that article 1 needs to be after article 3. Make the changes below:
| Pos | Title |
| 0 | Article5 |
| 35 | Article1 |
| 20 | Article2 |
| 30 | Article3 |
| 40 | Article4 |
Click "Send" and it looks like
| Pos | Title |
| 0 | Article5 |
| 10 | Article2 |
| 20 | Article3 |
| 30 | Article1 |
| 40 | Article4 |
It really is a lot less work than looking through files, altering them, and then having to do it all over again each time a new version comes out, especially if it's in the Source files.
I see, but when i write a new article i manually have to select a block to show it in on the frontpage?
I was kind a hoping not to have to do that. :)
Andreas
When you create a new article, you would also create a frontpage block to show it in. Would take you maybe a minute if you're on a very slow server. And this would only be temporary. Bloc has said that he'll likely add a feature which will allow you to do what you want in a later version of TP.
I'm not real keen on writing a whole lot of code when there's a way to achieve the same end without writing the code and there's another even easier way coming along later. Just lazy I guess. :)
Editd to add:
You could also just have your sticky article in a block, your php block and another php block that would show the most recent x number of articles.
Okey, I see.
One more thing then. :) If im going to do it this way, i will have to remove the linktree icon that shows on the top of my frontpage. this one -> (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.hsdk.no%2Fandreas%2Ftestforum%2Fsmf_1-1-rc3_install%2FThemes%2FTP_smFox%2Fimages%2Fnav_inline_start.gif&hash=982b36a5d43f250c8cdd5c5433f599f5925ef524) How could i do this?
See my testsite here: http://www.hsdk.no/andreas/testforum/smf_1-1-rc3_install/index.php
And, THANKS for taking your time to explain this. :)
In TPortal.template.php, right at the beginning of the file, comment out -- put // at the beginning of -- the following lines:
if((isset($context['TPortal']['boardnews'][0]['options']['linktree']) && $context['TPortal']['front_type']!='frontblock') || $context['TPortal']['front_type']=='frontblock')
echo '
<div style="margin-bottom: 4px;">', theme_linktree() , '</div>';