Support Forum
Curious if this is easy or...a pain. I want to run a conditional in spHead.php to check if it's the GroupView. Reason being, in the spGroupView.php file, I'm running the search functionality below a custom part of that page. Problem is, the search feature is run in spHead.php as well.
I'd like to declare a conditional, like WordPress' "is_page()", that detects if it's the groupView, and if so, don't show the search feature.
Is this possible via a template tag? I see in the wiki an sp_is_groupview. Please, oh, please tell me it'll do what I want?
yes, of course!
see our codex: http://codex.simple-press.com/.....functions/
the Primitives section...
you will see checks for different types of page views... we are still in the process of populating those pages with detailed info...
but usage for your example is quite simple:
if (sp_is_groupview()) { # do group view stuff } else { # do other page stuff }
alternatively, a little less clean, but you could look at a global array $sfvars and the 'pageview' element... but nicer to use the API...
Visit Cruise Talk Central and Mr Papa's World
Another option is to create a special header file for group view.
In the groupview php file you will see it loads sphead.php first. Create a copy of sphead.php, edit out or change what you want and save it as something like spGroupHead.php.
The change groupview.php to use it instead of sphead.php.
Both awesome suggestions. I didn't think of the latter, which is genius. Wanting to keep files to a minimum (no reason other than I prefer minimalist setup), I went with the sp_is_groupview(). Worked beautifully!
Thanks to the both of you.
We're building it on http://www.ornishspectrum.com. Once all the dev is done, we'll be opening up the forum (likely next week) and I'll enter it in the "show your stuff" area.
1 Guest(s)