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 » Tue Aug 19, 2014 12:58 pm

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: 14810
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten » Tue Aug 19, 2014 6:29 pm

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 » Wed Aug 20, 2014 9:16 am

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: 14810
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten » Wed Aug 20, 2014 9:21 am

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 » Wed Aug 20, 2014 9:29 am

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 » Wed Aug 20, 2014 10:00 am

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 » Wed Aug 20, 2014 12:41 pm

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: 14810
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten » Wed Aug 20, 2014 7:12 pm

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 » Thu Aug 21, 2014 10:25 am

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: 14810
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Replacing the news + same links

Post by Thorsten » Thu Aug 21, 2014 10:35 am

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 » Thu Aug 21, 2014 10:52 am

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