My header information is repeating on every webpage. I don't know how to remov

Discussion in 'PHP' started by leftysgirl, Aug 20, 2014.

  1. #1
    OK- forgive me, I am not familiar with all of the correct terminology here. I just found out that my site has a "static default" for its meta name & keywords that is appearing on all webpages of my web site. I would like to make it "dynamic" according to each page. I am trying to SEO each page individually and can't seem too because of my current setup. How do I remove this? The site was built with CakePHP.

    I tried looking in the header.ctp, index.ctp, a bunch of css files, some other files and I am lost. Nothing is sticking out to me, and I can't seem to find what I need to address.

    Any tips on where I could find more information on this is appreciated or even better if someone can tell me what files and wording I should look for, and what I should be changing it to.

    I would like to research this myself more. What are the terms I should use to Google up a tutorial? I am not having any success with using static and dynamic, etc.

    I can upload any script here if someone wanted to take a peak.

    my site is: r.... .e .. .n ..t... a... l.... . .o ..l..o... g ... y .. dot n. .e .t

    Thanks!
     
    leftysgirl, Aug 20, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    I don't know CakePHP, but I'm assuming that the relevant information is included somewhere in the template files, most likely in the header.ctp - could you perhaps post the content of header.ctp here? Please remember to put the content inside CODE-tags (bbcode) so it's properly formatted.
    Other than that, you could do a search through all the files for the webpage, and search for "meta name="
    As for how you would make these dynamic, it depends a bit on how the page is coded - most likely you would need to pull some variables, or do a DB-call, as I'm assuming the content as it is today, is hard-coded in a single file being included in all pages. This would have to be redone, somehow - for instance, if you don't want to mess around with the database, you could pull the values for the meta-tags via a single file being included, and then only include things based on the page-name, or some other criteria.
     
    PoPSiCLe, Aug 20, 2014 IP
  3. leftysgirl

    leftysgirl Greenhorn

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Thanks for your thoughts! Here is my headers code, but I did not see anything that stood out. Any ideas?

    <!-- !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html  xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-language" content="en-us" />
    <link rel="shortcut icon" type="image/x-icon" href="http://mywebsite.net/favicon.ico" />
    <title>blah,blah. trying to fix stuff!</title>
    <meta name="Description" content="More awesome words here" -->
    
    <div id="header">
                   
        <!--headerFst-->
        <div class="headerFst">
       
            <div class="welcomeCntnr">
           
                <ul>
                    <?php
                    
                     if($session->read('username')!="" && @$user->data['username'] != 'Anonymous' )
                     {
                     ?>
                        <li><span class="font-wieght">WELCOME</span>, <?php echo $session->read('username') ?> </li>
                       
                        <li>|</li>
                        <li> <?php echo $html->link('MY ACCOUNT',array('controller'=>'members','action'=>'my_account')); ?> </li>
                       
                        <?php  if($session->read('member_type')=="owner"){ ?>
                       
                        <li>|</li>
                        <li> <?php echo $html->link('MY LISTINGS',array('controller'=>'members','action'=>'my_listings')); ?> </li>
                        <li>|</li>
                        <li> <?php echo $html->link('MY FAVORITES',array('controller'=>'members','action'=>'my_favorites')); ?> </li>
                   
                        <?php } ?>
               
               
                <?php }
                      else
                      { ?>
                            <li><span class="font-wieght">WELCOME</span>, GUEST</li>
                <?php } ?>       
                   
                   
                    <?php
                    if ($session->read('username')=="")
                    {
                    ?>
                        <li>|</li>
                        <li> <?php echo $html->link('REGISTER',array('controller'=>'members','action'=>'usertype_option'));?> </li>
                        <li>|</li>
                       
                        <!--<li><?php //echo $html->link('LOGIN','javascript:void(0);',array('controller'=>'members','action'=>'log_in')) ;?></li>-->
                       
                        <li><?php echo $html->link('LOGIN',array('controller'=>'members','action'=>'log_in')) ;?></li>
                <?php }
                    else
                    { ?>
                        <li>|</li>
                        <li><?php echo $html->link('LOGOUT',array('controller'=>'members','action'=>'log_out')) ;?></li>
                
                 <?php } ?>
                
               
                    <li>|</li>
                    <li><?php echo $html->link('HELP',array('controller'=>'faqs','action'=>'index')) ;?></li>
                   
               
               
                </ul>
           
            </div>
           
       
        </div>
                    <!--headerFst-->
                   
                    <div style="float:right; margin-top:10px;">
                   
            <!-- Go to www.addthis.com/dashboard to customize your tools -->
    <div class="addthis_horizontal_follow_toolbox"></div>
    <script type="text/javascript">
      (function() {
        var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
        po.src = "https://apis.google.com/js/plusone.js?publisherid=113504811744303139636";
        var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
      })();
    </script>
    
    
            </div>
           
                    <!--logoNavContnr-->
                    <div class="logoNavContnr" style="">
                   
                        <!--logo-->
                        <div class="logo" style="float:left;">
                       
                            <?php echo $html->link($html->image('rental_logonew.png'),array('controller'=>'homes','action'=>'index'),array('escape'=>false)); ?>
                           
                       
                        </div>
                        <div class="logo" style="float: right; margin-right: 470px; padding-top: 40px;">
                       
                            <?php /* echo $html->link($html->image('free-join.png'),array('controller'=>'homes','action'=>'index'),array('escape'=>false)); */ ?>
                            <img src="/img/img.png" alt=good stuff here">
                       
                        </div>
                        <!--logo-->
                      
                               
                        <!--navigationCntnr-->
                        <div class="navigationCntnr" style="width:600px;">
                       
                       
                         
                        <?php if($this->params['controller']!='homes' && $this->params['action']!='index')    {?>   
                            <div class="navigation naviInner">
                                <ul>
                                    <li> <li>
                                    <li> <?php echo $html->link('',array('controller'=>'members','action'=>'find_rental'),array('class'=>'nav1H','escape'=>false)); ?> <li>
                                    <li> <?php echo $html->link('',array('controller'=>'properties','action'=>'list_property'),array('class'=>'nav2H','escape'=>false)); ?> <li>
                                    <li>
                                        <?php echo $html->link('',"../forums/",array('class'=>'nav3H','escape'=>false));?>
                                    </li>
                                    <li>
                                        <?php echo $html->link('',array('controller'=>'members','action'=>'contact_us'),array('class'=>'nav4H','escape'=>false));?>
                                    </li>
                   
                                   
                                 </ul>
                            </div>   
                           
                           
                           
                       
                            <?php } ?>
                           
                           
                           
    
                        </div>
                       
                       
                        <!--navigationCntnr-->
                   
                    </div>
                    <!--logoNavContnr-->
               
    </div>
    <!-- /body>
    </html -->
    Code (markup):
     
    leftysgirl, Aug 20, 2014 IP
  4. lektrikpuke

    lektrikpuke Well-Known Member

    Messages:
    297
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    113
    #4
    Have you tried CakePHP's community help and support (as listed on site): http://webchat.freenode.net/?channels=cakephp&uio=MT1mYWxzZSY5PXRydWUmMTE9MjQ2b8
     
    lektrikpuke, Dec 9, 2014 IP
  5. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #5
    the header CODE wouldnt be in that. Thats the final code written to HTML display /browser. You'd be looking for a file that has the PHP code in it not the view source version of that page once its rendered.
    In that other file somewhere the header.php (if its called that) has the header set up with your meta tags , title etc. and is being pulled in by includes('header.php');
    on every page as part of a TEMPLATE design. Find the actual PHP page that is used by your server to display, open it and get rid of the header.php
    then you'll have to code HTML your own meta, title, etc on each page. Go now! may the shwartz be with you.
     
    ezprint2008, Jan 12, 2015 IP