1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Your Own Home Page File

Discussion in 'Bookmarking Discussions and More' started by Sv9t, Jul 13, 2015.

  1. Sv9t

    Sv9t Active Member

    hi! home page hasn't changed its design
    1) i copied file index.php, renamed home.php, deleted all codes in it, exept:
    Code:
    <html>
    Welcome Hotaru!
    </html>
    2) downloaded it in theme folder
    3) changed line 6 in file index.php
    Code:
    // set a custom home page:
    $h->setHome('home');
    4) But on home page i don't see message "Welcome Hotaru!" and also displayed sidebar, breadcrumbs, sort box (Popular, Upcoming, Latest, All)
    how me changed design home page?
    Thx!
     
    Last edited: Jul 13, 2015
  2. valMETNG

    valMETNG Administrator Staff Member Admin

    It's not clear exactly what you're trying to accomplish but if you only want to display "Welcome Hotaru," you need only put "Welcome Hotaru" between the <body> tags in your custom theme's index.php file (i.e., remove everything else between lines 61 and 148).
     
  3. Sv9t

    Sv9t Active Member

    I want do own design home page, which differs from the other pages. in the home page must remain header, categories and some few sidebars.
    "Welcome Hotaru" - this is test how change design will work.
     
  4. Sv9t

    Sv9t Active Member

    This example home page
     

    Attached Files:

  5. valMETNG

    valMETNG Administrator Staff Member Admin

    I see. Well, that might be a bit difficult without modifying the bookmarking plugin. In the admin section for bookmarking, you can select which page (e.g., popular, all) is the home page. Assuming you wanted to keep all the existing options, you could define a new page but it would require PHP customizations in multiple places.

    Perhaps an easier way if you don't know PHP is to check for a blank URI in your index.php file. Something like this to replace lines 105-107:
    Code:
    <?php $uri = trim($h->cage->server->sanitizeTags('REQUEST_URI'), '/');
         if ($uri == false || $uri == 'index.php') { ?>
              Welcome Hotaru!
    <?php } elseif (!$h->pluginHook('theme_index_main')) {
      $h->template($h->pageName, 'pages');
      } ?>
    I think that should accomplish what you want.
     
  6. Sv9t

    Sv9t Active Member

    I thought in the this post says how to change the main page. No?
     
  7. Sv9t

    Sv9t Active Member

    ok, this is work. I also want delet only in the home page sidebar, breadcrumbs, sort box (Popular, Upcoming, Latest, All)
     
  8. valMETNG

    valMETNG Administrator Staff Member Admin

    Sadly, the Hotaru documentation is a bit out-of-date. I just tried to follow the directions from that post and it didn't work. Hotaru has been through significant upgrades thanks to @shibuya246's hard work, but the documentation hasn't been kept up. Did the code I posted not work?
     
  9. Sv9t

    Sv9t Active Member

    Work! But i want have own file home page, where I can creat any design))
    User narc created it!)
     
  10. valMETNG

    valMETNG Administrator Staff Member Admin

    Some of the Hotaru code like the index.php has comments that make it easy for you to see what code does. For example, on line 98 of the index.php file, you'll see this:
    Code:
    <!-- POST BREADCRUMBS -->
    The <!-- text goes here --> is a comment about the code that follows - it doesn't execute any code. So, for example, if you don't want the breadcrumbs, you could delete the line right below that comment (line 99). However and for example, if you only don't want the breadcrumbs when on the home page, you need to use the previous if statement. So, as you've already defined your variable $uri, you could replace line 99 with something like this:
    Code:
    <?php if ($uri && $uri != 'index.php') { $h->pluginHook('theme_index_post_breadcrumbs'); } ?>
    This basically means "if the $uri variable has a value and the value of $uri does not equal 'index.php', go execute this statement." You can do something similar with the other parts of the page you don't want.
     
    Sv9t likes this.
  11. valMETNG

    valMETNG Administrator Staff Member Admin

    In the forum, if you put an @ sign in front of the user's name, that user will be notified someone mentioned his name (e.g., @narc).
     
    Sv9t likes this.
  12. Sv9t

    Sv9t Active Member

    ok, I'll try do it...
    thanks valMETNG!
     
    valMETNG likes this.

Share This Page