Replacing the news + same links

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Replacing the news + same links

Post by tomperys »

Hi

1) Its possible to replace the news which are on the home page in the main content under the search bar, with some own PHP file? If so, pls where can I remove the news and paste the include(); string?
2) Its possible to have same categories? For example I will have main category "computer" and "notebook" and and I would like to have same subcategory "memory" in both of them (see below). We can create subcategory with same name, however they will not refer to the same page with the same records...

+ computer
- memory
+ notebook
- memory

Thanks a lot
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten »

Hi,

1) see http://faq.phpmyfaq.de/content/3/9/en/a ... ework.html and change the contents of news.php and news.tpl

2) sure, that's possible

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: Replacing the news + same links

Post by tomperys »

Thanks,

I tried it according to the instructions (includint the own php file) but still nothing. I created the tpl and php file, tpl is placed in template folder, php in root folder. I changed the constants.php. The content is not displayed. And I still dont know how to disable the "news" content - I tried to comment out the lines in news.php in root folder, but the news content is still there :((
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten »

Hi,

sorry, I meant, you should edit news.php and news.tpl to your wishes :)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: Replacing the news + same links

Post by tomperys »

Ok i replaced the news.tpl and news.php with my own code and nothing happend...as if the news content were somewhere else :(
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: Replacing the news + same links

Post by tomperys »

Ok I founf that the news content on the index page is in the main.php file. But so far no luck with replacing it by something else.
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: Replacing the news + same links

Post by tomperys »

If i put include('mypage.php'); to main.php file -> and it does not matter if just as an line of code itself or inside the $tpl->parse('writeContent', array('testContent' =>include('mypage.php'), .... the result is still same = the content of mypage.php appear above the content (just below the top bar)
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten »

Hi,

can you post your code somewhere, maybe in a GitHub Gist?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: Replacing the news + same links

Post by tomperys »

Ok, there are here https://github.com/tomperys/MyFAQ2 - the main .tpl and .php
I have to (at least for now) add the whole code manualy to the .tpl file, because I didnt found a way to use the "include" function (I tried that in the main.php file, but as I told already the content appear right below the top bar, not on right place on the index page (so in the middle of the content below the search box).
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten »

Hi,

the template variable "twittContent" is not in main.tpl, so it cannot be displayed

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: Replacing the news + same links

Post by tomperys »

yes i know because i replaced it with the code itself... but it was there and as i said - the content appeard below the top bar and in the place where was the {twittContent} was only char "1"
Post Reply