Jump to content

Struggling with Syntax and homepage URL


ankh2054
 Share

Recommended Posts

Hi All,

I really seem to be struggling with the syntax of process wire, could anyone point me in the right directoin of some good documents or tutorials to read.

I am trying to link back to my homepage / via the below and can't get it to work.

<a class="navbar-brand" href="<?php echo $pages->get('/') ?>"><?php echo $pages->get("/site-settings/")->site_title; ?></a>

What does everyone else use to go back to the root URL?

thanks

Link to comment
Share on other sites

Not sure why  and how, but I seem to have tried  href="/" and now it works. Must not of uploaded changes. oops.

Any documentation of syntax would really help me.  As a non PHP coder, I struggle to understand when to use 

<?php ,  {, ", ', 

etc....

thank

Link to comment
Share on other sites

thanks all for being so patient :)

Could someone help me with the below, I am trying to show the name of the current logged in user.

<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php $user->name; ?><b class="caret"></b></a>

Link to comment
Share on other sites

thanks that worked :) Just leaving my code, for other people who might struggle like me :)

<?php if($user->isLoggedin()): ?>
               <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $user->name; ?><b class="caret"></b></a>
                <ul class="dropdown-menu">
                   <li><a href="[[~12]]"><i class="icon-user"></i> My Account</a></li>
                   <li><a href="[[~12]]"><i class="icon-envelope"></i> Inbox <span class="badge badge-info"></span></a></li>
                   <li class="divider"></li>
                   <li><a href="?logout=1" title="Logout"><i class="icon-off"></i> Logout</a></li>
                   
                </ul>
              </il>
            <?php else: ?> 
          
               <li><a href="/register/">Sign up</a></li>
               <li><a href="/login/">Login</a></li>
            

            <?php endif; ?>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...