Scripting Front Page Problems

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Scripting Front Page Problems

Postby Justin » Thu Jan 01, 2015 11:20 pm

Hi all, Happy New Year!

I am hoping someone can help with what I hope is a simple solution.
Is it possible to get the following code working on the front page script?

Code: Select all
[[ if in_array('big-chief-studios', $category) ]] [[image file="2015-01/main_banner_bigchief-custom.png" ]] [[ /if ]]
[[ if in_array('default', $category) ]] [[image file="2015-01/main_banner_dwafo-custom.png" ]] [[ /if ]]
[[ if in_array('character-options', $category) ]] [[image file="2015-01/main_banner_characteroptions-custom.png" ]] [[ /if ]]
[[ if in_array('rubbertoe-replicas', $category) ]] [[image file="2015-01/main_banner_rubbertoe-custom.png" ]] [[ /if ]]
[[ if in_array('titan-merchandise', $category) ]] [[image file="2015-01/main_banner_titan-custom.png" ]] [[ /if ]]<br>


I have tried a few things but struggling.

Also, how do you adjust the left margin on nivoslider and is there a way to get the nivoslider to link to articles, even better with a way to grab the image file from the article to display?

Code: Select all
[[ if tag_exists('nivoslider') ]]

                    [[nivoslider
                       
                        path                = "pivotx/templates/phoenix/slides"
                        cssFile             = "pivotx/templates/phoenix/css/style.css"
                        orderby             = "date_asc"
                        caption             = 1
                       
                        animSpeed           = 500
                        pauseTime           = 3000
                        startSlide          = 0
                        effect              = "random"
                        directionNav        = 1
                        directionNavHide    = 1
                        controlNav          = 1
                        controlNavThumbs    = 0
                        controlNavThumbsFromRel = 0
                        controlNavThumbsSearch  = ".jpg"
                        controlNavThumbsReplace = "_thumb.jpg"
                        keyboardNav         = 1
                        pauseOnHover        = 1
                        manualAdvance       = 0
                        captionOpacity      = 0.8
                        prevText            = "Prev"
                        nextText            = "Next"

                    ]]
                [[ else ]]
                    <div id="sliderwarning" class="warning">
                        <p>The 'Nivo Slider' extension has not been installed, or is not active. Without this extension, you will not be able to enjoy the full awesomeness of this theme, although it will work just fine.</p>
                        <p>Please <a href="http://extensions.pivotx.net">install the extension</a>, or edit <em>_sub_header.tpl</em> in the template directory to remove this message.</p>
                    </div>
                [[ /if ]]


Many thanks for any help received,

Justin
Justin
 
Posts: 17
Joined: Sun Jan 20, 2013 3:02 pm

Re: Scripting Front Page Problems

Postby Harm10 » Sat Jan 03, 2015 11:28 am

Happy New Year to you too!

First: these are 2 unrelated questions so please create separate entries for them................... ;)
I assume you will create a new one for the Nivoslider question so I will only give you a reply to the first question.
On the front page there are only the weblog variables defined. You can code something like this in the subweblog loop of your template where the entries are processed. This code could also work on a detail webpage where you display 1 entry. To address the entry's categories you need to specify $entry.category which is an array.

What is also helpful is to activate debug mode which not only gives you a debug log through the dashboard but also a tiny green icon with a plus in the upper right corner of your site which will show you some interesting data when you click on it.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)


Return to 2.x Support Forum

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron