Need help with own theme

Development related discussion.
User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Need help with own theme

Post by paulhobbel » Thu Jul 31, 2014 10:14 am

Hello can somebody help me,
 
I started making my own theme for Traq based on Bootstrap.
Everything is fine but i cant find a way to add a class to an input tag:

Code: Select all

Form::text('settings[title]', array('value' => settings('title')));
need to get:

Code: Select all

class="form-control"
and where can i find the id's of these input tags
 
Oh and btw you can find my theme on github: https://github.com/paulhobbel/Traq-Them ... /bootstrap
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

User avatar
Jack
Advanced Member
Posts: 666
Joined: Fri Mar 27, 2009 7:37 pm
Location: Australia

Re: Need help with own theme

Post by Jack » Thu Jul 31, 2014 5:14 pm

Adding a class ID to or change the ID of any Form or HTML helper created element can be done like so:

Code: Select all

<?php echo Form::text('name', array('value' => $user->name, 'class' => "form-control", 'id' => "users_name")); ?>
Most, if not all, HTML and Form helper methods can have classes added to them this way. For example, the "Form::text(...)" method is a shortcut to the "Form::input(...)" method just like most of the other form helper methods, so it's exactly the same as the above.
 
Documentation for classes and functions for Traq 3.x and its framework is, well, complete crap. This however will be changing with Traq 4.0. Until then, hopefully the docblocks and code comments will be able to help, even if only a little.

User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Re: Need help with own theme

Post by paulhobbel » Thu Jul 31, 2014 8:09 pm

Thank you very much it worked :D
Last edited by paulhobbel on Thu Jul 31, 2014 9:04 pm, edited 1 time in total.
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Re: Need help with own theme

Post by paulhobbel » Thu Jul 31, 2014 11:21 pm

Can you take a look, I want to know if you like it already :D
 
 
You do not have the required permissions to view the files attached to this post.
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

User avatar
timoline
Newbie
Posts: 9
Joined: Thu Jul 31, 2014 10:07 pm

Re: Need help with own theme

Post by timoline » Fri Aug 01, 2014 12:32 am

I Like it !

User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Re: Need help with own theme

Post by paulhobbel » Fri Aug 01, 2014 1:21 am

Thnx :D
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

User avatar
timoline
Newbie
Posts: 9
Joined: Thu Jul 31, 2014 10:07 pm

Re: Need help with own theme

Post by timoline » Fri Aug 01, 2014 2:02 am

I'm new here and try to read as many as possible, but how to install this theme after downloading it from github?
 
edit: aha found it...copy to views folder and select theme in admincp :)
Last edited by timoline on Fri Aug 01, 2014 3:12 am, edited 1 time in total.

User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Re: Need help with own theme

Post by paulhobbel » Sat Aug 02, 2014 1:34 pm

Ey timoline, I updated allot things including your idea please download the new one and tell me what you think about it already
On the Roles and Users page are all functions working already
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Re: Need help with own theme

Post by paulhobbel » Sat Aug 02, 2014 1:41 pm

You can also try it at http://bugs.alphasloth.tk and login with username: demo and password: demo
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

User avatar
paulhobbel
Member
Posts: 28
Joined: Thu Jul 31, 2014 10:06 am
Contact:

Re: Need help with own theme

Post by paulhobbel » Sat Aug 02, 2014 11:07 pm

Hello is there anybody who can help me with the folowing:

Im trying to show the users name into the navbar but the folowing code will only work if I load the usercp page, else it will not show anything but if i logout i will say "Not logged in" so that part is working.

This is the code:

Code: Select all

<?php if (LOGGEDIN) { echo ($user->name); } else { echo ('Not logged in'); } ?>
Full _meta_nav.phtml code:

Code: Select all

<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php if (LOGGEDIN) { echo ($user->name); } else { echo ('Not logged in'); } ?><i class="fa fa-user fa-lg"></i><span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<?php FishHook::run('template:layouts/_meta_nav/user_nav'); ?>
<?php if (LOGGEDIN) { ?>
<li<?php echo iif(active_nav(current_user()->href()), ' class="active"')?>><?php echo HTML::link(l('profile'), current_user()->href()) ?></li>
<li<?php echo iif(active_nav('/usercp'), ' class="active"')?>><?php echo HTML::link(l('usercp'), '/usercp'); ?></li>
<?php if ($current_user->group->is_admin) { ?>
<li<?php echo iif(active_nav('/admin(.*)'), ' class="active"')?>><?php echo HTML::link(l('admincp'), '/admin'); ?></li>
<?php } ?>
<li class="divider"></li>
<li><?php echo HTML::link(l('logout'), '/logout'); ?></li>
<?php } else { ?>
<li<?php echo iif(active_nav('/login'), ' class="active"')?>><?php echo HTML::link(l('login'), '/login'); ?></li>
<?php if (settings('allow_registration')) { ?>
<li<?php echo iif(active_nav('/register'), ' class="active"')?>><?php echo HTML::link(l('register'), '/register'); ?></li>
<?php } ?>
<?php } ?>
</ul>
</li>
Last edited by paulhobbel on Sat Aug 02, 2014 11:13 pm, edited 1 time in total.
Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests