Advertisement:

Author Topic: [SOLVED]hide search bar in the page  (Read 5883 times)

Gabender

  • Jr. Member
  • **
  • Posts: 53
[SOLVED]hide search bar in the page
« on: November 22, 2013, 12:35:46 am »
hello guys, how can I hide the search bar in the publishing page ads?
« Last Edit: November 23, 2013, 07:32:18 pm by Gabender »

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: hide search bar in the page
« Reply #1 on: November 22, 2013, 07:23:48 pm »
hide it or remove it? you could comment out the code <!--the search barcode-->


Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #2 on: November 22, 2013, 09:24:32 pm »
Unfortunately, the code is in the 'header.php so I should exclude the bar by an IF in php code. I can not delete it from the page because the header always appears I should act differently .. any ideas?

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: hide search bar in the page
« Reply #3 on: November 22, 2013, 10:28:13 pm »
Hi,
you can try to add 
Code: [Select]
<?php if( !osc_is_publish_page() { ?> <!--the search barcode--> <?php ?>
in header.php

Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #4 on: November 23, 2013, 01:33:44 am »
 :D YEES ! GREAT! thank you very much problem solved!

Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #5 on: November 23, 2013, 01:40:10 am »
if you wanted to hide in 2 pages but does not act
Code: [Select]
if(!osc_is_home_page() || (!osc_is_publish_page()))  { ?>

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: hide search bar in the page
« Reply #6 on: November 23, 2013, 07:41:15 am »
Hi,

                              I dont know if result because i do not test this... but try
Code: [Select]
<?php if(!osc_is_publish_page()) {?>
<!--the search barcode-->
                                                                               <?php }
elseif (!osc_is_home_page()) {?>

<!--the search barcode-->
<?php }
else {?>

<!--  -->
<?php }?>
                              
                              the other solution is: duplicate the header and renamed for headerb.php
                              remove the search bar code
                              
                              and call the headerb.php for all pages you need without search bar code
                              
                              with this call for the pages you need: 
Code: [Select]
<?php osc_current_web_theme_path('headerb.php') ; ?>                              
                              I think this is the best solution for many pages you go need remove the search bar code
                              
                              Regards

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: hide search bar in the page
« Reply #7 on: November 23, 2013, 08:55:41 am »
Quote
if you wanted to hide in 2 pages but does not act
Code: [Select]
if(!osc_is_home_page() || (!osc_is_publish_page()))  { ?>

there is a sintax error in your code, should be

<?php if ( (!osc_is_home_page() ) || (!osc_is_publish_page()))  { ?>

Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #8 on: November 23, 2013, 12:11:32 pm »
using this common prayer does not work, it appears on all pages
Code: [Select]
<?php if ( (!osc_is_home_page() ) || (!osc_is_publish_page()))  { ?>
instead of using an "else" should recopy the code of the bar, some "nested if"?

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: hide search bar in the page
« Reply #9 on: November 23, 2013, 05:35:33 pm »
In wich pages you want to show the search bar?

Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #10 on: November 23, 2013, 05:57:42 pm »
In wich pages you want to show the search bar?
should only be concealed on the homepage and publish page

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: hide search bar in the page
« Reply #11 on: November 23, 2013, 06:37:27 pm »
Sorry, i make a mistake earlier, try this

<?php if( !osc_is_home_page() || !osc_is_publish_page() ) { ?>

Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #12 on: November 23, 2013, 06:42:07 pm »
Sorry, i make a mistake earlier, try this

<?php if( !osc_is_home_page() || !osc_is_publish_page() ) { ?>

does not work, so the bar can be seen on all pages  :'(

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: hide search bar in the page
« Reply #13 on: November 23, 2013, 06:45:12 pm »
i don't understand why, can you pass all your search code, so i can try?

Gabender

  • Jr. Member
  • **
  • Posts: 53
Re: hide search bar in the page
« Reply #14 on: November 23, 2013, 06:51:06 pm »
i don't understand why, can you pass all your search code, so i can try?

Code: [Select]
    <?php if( !osc_is_home_page() || !osc_is_publish_page() ) { ?>
        <form action="<?php echo osc_base_url(true); ?>" method="get" class="search nocsrf" <?php /* onsubmit="javascript:return doSearch();"*/ ?>>
        <input type="hidden" name="page" value="search"/>
        <div class="main-search">
            <div class="cell">
                <input type="text" name="sPattern" id="query" class="input-text" value="" placeholder="<?php echo osc_esc_html(__(osc_get_preference('keyword_placeholder''bender_theme'), 'bender')); ?>" />
            </div>
            <?php  if ( osc_count_categories() ) { ?>
                <div class="cell selector">
                    <?php osc_categories_select('sCategory'null__('In tutte le categorie''bender')) ; ?>
                </div>
                <div class="cell reset-padding">
            <?php  } else { ?>
                <div class="cell">
            <?php  ?>
                <button class="ui-button ui-button-big js-submit"><?php _e("Search"'bender');?></button>
            </div>
        </div>
        <div id="message-seach"></div>
    </form>
    <?php ?>