[RESOLVED] Plugin Theme : Sidebar option - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8) +--- Thread: [RESOLVED] Plugin Theme : Sidebar option (/showthread.php?tid=2889) |
[RESOLVED] Plugin Theme : Sidebar option - didou038 - 2012-03-07 Hi all ! I'm working on a new template, and I wish to add an option to activate the sidebar. I based my work on the Innovation Theme Plugin, and I created a radio box to select YES or NO to activate the sidebar. I have got a problem, the XML file is well generated, but the option still null. After I need to read the result, if it's YES (true) then the sidebar is displayed otherwise it's not. That is done in template.php. I am not sure how to do this. In attachments you'll find the template, just move cyclehomePlugin.php into plugins directory. Thank you for your help, I'm sure it's simple but it has to blind me. [RESOLVED] Plugin Theme : Sidebar option - n00dles101 - 2012-03-07 Here's an updated plugin file for you. Should work as expected. the problem was you were save the value of $_POST['sidebaractive'] whereas you should have been saving the value of your radio group 'option1' added some code to the radio button to make sure the current value is also set. Mike... Code: <?php [RESOLVED] Plugin Theme : Sidebar option - didou038 - 2012-03-07 Thank you n00dles101 ! Can you tell me how to read the value of sidebaractive in my template ? edit : i find it ! Code: <?php [RESOLVED] Plugin Theme : Sidebar option - n00dles101 - 2012-03-07 It's either going to be set to 'YES' or 'NO' so change the code to Code: <?php [RESOLVED] Plugin Theme : Sidebar option - didou038 - 2012-03-07 yes, I tried to read the value with a bad method, I changed the value yes or no to true or false. After I found the solution, and I left the default value to true or false. I modified your code accordingly. Now my template is able to adapt to the presence of the sidebar in terms of size. The code in the template is as follows: Code: <div id="site_content"> Thank you for your attention n00dles101 ps : sorry for my very bad english, I try my best ^^ [RESOLVED] Plugin Theme : Sidebar option - n00dles101 - 2012-03-07 No problem. Glad you got it working.... |