Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
720 views
in Q2A Core by

Dear Q2A-members!

Hope, that someone can help me. I will try to explain the problem as best as I can. Sorry for my english!

What I would like to do:

Default on the main page are the questions and answers displayed.
That's great but I would like to include a slideshow on the top of the "<div class="qa-main">..
The Problem which I have is that I don't know which file I have to edit.
If I do include the slideshow-script in the qa-theme.php file,  the slideshow is included on every page! But it should be displayed only on the main page (home page, first page). 

Thanks in advance! :)

Best regards

Q2A version: 1.6.1

1 Answer

+2 votes
by
selected by
 
Best answer

If you want to display featured question on your slider show than you can my plugin http://store.q2amarket.com/store/products/advance-featured-questions/

With this you will be able to display featured question slideshow on any registered places on the Q2A. Including main area, or any page, sidebar widget etc.

If you are looking for slideshow only and want to put own content than this may help you http://store.q2amarket.com/store/products/q2am-jquery-ticker/. But not sure what exactly you are looking in slideshow so please mention your type of content you want to display so can understand your exactl requirement. 

If you are looking for something what you can do your own and than here are some steps you need to

  • Register js bundled with slidershow
  • Register css bundel with slideshow
  • You may need to modify theme css
  • register layer or override in theme file where you want to display
  • if you are doing in theme than either you can add static slide or make function to add dynamically content as you want.

EDIT:

To override qa_main() function

function main()
{
if(qa_request() == '')
//your slider code here
 
qa_html_theme_base::main();
}
 
OR
 
function main()
{
if($this->template == 'qa')
//your slider code here
 
qa_html_theme_base::main();
}
by
edited by
Thanks for your answer! :)

You're plugin is really awesome! I'm sure that I will need you're plugin later.

But for the moment what I would like to know is which .php file I have to edit for the "first page" to add own html, php code only at the first page on the content. :)

Thanks in advance!

Best regards
by
You need to add or override base function in qa-theme.php file or your theme. Just drop above code in qa-theme.php file and see the magic.
by
Thanks again but it doesn't really work.

Let's say:
I would like to output a simple text "Welcome on the first page" above in the content only on the first page.
If I add the php code in the qa-theme.php or qa-theme-base.php it show's on every
 page of the website the text "Welcome on the first page".

Hope you can help me again. :)))
by
You should not modify qa-theme-base.php anything you want to add use qa-theme.php

qa_requestion and/or $this->template should work. See my Hide Sidebar Plugin.

To cross check echo anything instead of php output something like $this->output('test content here'); replace or add after //your slider code here
by
I got it finally! Thanksss so much. :)))
by
Good.. You are welcome.. If answer works than select it so others can refer to the same..
...