HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Attempting a new theme

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#26527 (In Topic #6149)
Avatar

Community saint

Okay, I'm attempting to create a new theme, but I'll warn y'all, I'm a "chimp method" coder. :lol:  It'll probably take me weeks and weeks!

This is the site that I'm using for inspiration.  Obviously, I don't want to copy it exactly, but I really love this style, super clean, classy, subtle and makes all the pictures really pop out. 

So, being as I'm no coder, don't know PHP and am new to ocPortal, my first step is I'm just chimping around in the global CSS file and changing the colors.  Don't worry, I made a copy and this is in a new theme folder.  I've managed to change some of the colors and am working to tweak things around until I get the general color scheme I'm working towards.

What I'm hoping for from y'all are some suggestions on things to watch out for, clues on tricky or hard to find things, etc.  Looking at my inspiration site, does anything leap to mind that could be done easily in ocPortal that would bring me closer to that ideal?  My site is unknown to the public, as yet, so it's a good one for messing around with and letting everybody see as I go along.

Let me know what y'all think! 

Valerie
 
Back to the top
 
Posted
Rating:
#26529
Avatar

Community saint

First real question - looking at Global.tpl, I'm looking at this section:

{+START,IF_NON_EMPTY,{$SHIFT_DECODE,PAGE_TITLE}}
   <div class="global_title">
      {+START,IF,{$IN_STR,{BREADCRUMBS},>}}
         <div class="breadcrumbs breadcrumbs_always">
            <img class="blend breadcrumbs_img" src="{$IMG*,treenav}" alt="> " />
            {BREADCRUMBS}
         </div>
      {+END}

This is the part where it tells it to print out the "Welcome to website" line, right?  What if I wanted to take out that welcome line and put a random quote there instead.  Would that be possible without messing up the breadcrumbs on the other side?

If possible, how would I do that? I see where it says to do the breadcrumb, but I can't tell exactly which part of the code tells it to print the welcome line.
Back to the top
 
Posted
Rating:
#26542
Avatar

This is one of the weirder areas.
This is the full segment you're looking at:

Code

{+START,IF_NON_EMPTY,{$SHIFT_DECODE,PAGE_TITLE}}
   <div class="global_title">
      {+START,IF,{$IN_STR,{BREADCRUMBS},&gt;}}
         <div class="breadcrumbs breadcrumbs_always">
            <img class="blend breadcrumbs_img" src="{$IMG*,treenav}" alt="&gt; " />
            {BREADCRUMBS}
         </div>
      {+END}

      {$SHIFT_DECODE,PAGE_TITLE}
   </div>
{+END}

The {$SHIFT_DECODE,PAGE_TITLE} bit is the page title.

What's actually happening with that SHIFT_DECODE stuff is ocPortal's actually moving the page title from a totally different place. Naturally the page title is a part of an ocPortal page, and pages exist in the main white area of the theme. ocPortal is actually pulling it out and placing it in it's special position.

If you want the page title to be displayed naturally remove the {$SHIFT_DECODE,PAGE_TITLE} bit, and edit PAGE_TITLE.tpl to:

Code

{+START,IF_PASSED,ID}
<a name="title__{ID*}"></a>
{+END}
<h1 id="main_page_title">{TITLE}&nbsp;&nbsp;&nbsp;</h1>
{+START,IF_NON_EMPTY,{HELP_URL}}
   <a title="{!LINK_NEW_WINDOW}" target="_blank" href="{HELP_URL*}#{HELP_TERM*}"><img class="blend" title="{!HELP}" alt="{!HELP}" src="{$IMG*,help}" /></a>
{+END}
{+START,SHIFT_ENCODE,PAGE_TITLE_SIMPLE}
   <h1>{TITLE}</h1>
{+END}
{+START,IF_PASSED,SUB}
   <div class="page_title_tagline">
      {SUB}
   </div>
{+END}

You can then put whatever you like in the space you've made where the title used to be.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#26568
Avatar

Community saint

Thanks! That was very helpful. I successfully changed the title back to a "normal" position.  I haven't figured out how to put a quote there yet, but now I'm not sure I want to.  I kinda like having the side panels snugging up to the top. I'll have to think about that to see if I want to push it down again.  

In the meantime, another question. I find that ocPortal is kinda random as to where it goes to find its theme files.  For instance, as I work on my new theme, it's going to the correct place for the CSS file and the templates, but the images I've made don't show up unless I put them in the Default theme images folder.  When I put them in my custom theme images or images_custom folder, they don't show up.  I've named the same as they were before, haven't changed any references, just uploaded a new image into the current theme's folder.

What am I doing wrong?
Back to the top
 
Posted
Rating:
#26571
Avatar

You have to deal with custom images through the adminzone's theme image interface, as their locations are stored in the database. ;)

Back to the top
 
Posted
Rating:
#26598
Avatar

Community saint

Ahhh….. I knew there was something! Thanks, I'll check that out.
Back to the top
 
Posted
Rating:
#26617
Avatar

Community saint

New question. I registered today, so it took the ocPortal logo off.  However, I wanted to put a "site powered by" link at the bottom of the page, so I edited the bottom.tpl file like this and just added in a link. Uploaded it, and nothing happened. It's like it's not even there. Do I have to do something special to add a link?

      <div class="global_copyright">
         {$COPYRIGHT}
         <div class="global_minilinks">
            <a accesskey="8" href="{$PAGE_LINK*,_SEARCH:privacy}">{!PRIVACY}</a> <span

class="linkcolor">·</span>
            <a accesskey="9" href="{$PAGE_LINK*,_SEARCH:feedback}">{!FEEDBACK}</a>
       <a href="ocPortal - where Content Management meets Web 2.0">This site powered by ocPortal</a>
         </div>
      </div>
      <br class="float_passer" />
   </div>
</div>
Back to the top
 
Posted
Rating:
#26619
Avatar

Community saint

Okay, never mind.  It just showed up!  Just took a while to see it, I guess.  Huh. :thumbs:
Back to the top
 
Posted
Rating:
#26621
Avatar

Unless you edit templates through the adminzone, you will need to clear the template caches for changes to show up. The easiest way to do this is to hold down Ctrl+Alt+Shift and refresh the page. :)

Back to the top
 
Posted
Rating:
#26630
Avatar

Community saint

I always have to use that comment no matter how I edit it or what browser I use.


I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#26665
Avatar

Community saint

All right, here's another one.  I changed the Main_Block_Forum_Topics template to change the title, like this:

{+START,BOX,{!IN_THE,{FORUM_NAME*}}}
   {CONTENT}
{+END}

I've uploaded it, and hit ctrl+shift+alt and refreshed the page multiple times, but no matter what I do, it still shows the "Active Topics in Forums" as the title.  

Why doesn't this work?  It's in the exact same format as the original….
Back to the top
 
Posted
Rating:
#26666
Avatar

Community saint

I think that to achieve this you'd need to do a bit more editing than you've done.

The 'string' you are trying to insert IN_THE
doesn't exist in 'global.ini'.

You'd need to add it to 'global.ini' and then call the string in sources/main_forum_topics.php in line 105.

However, I'm no coder either, so please wait for an 'official' fix from Chris, Philip, Allen or Robbie.

 :dry:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#26678
Avatar

Community saint

Ahh….. yes, the global.ini file!  You're right.  I just didn't even think of that.  I'll check that out tonight…
Back to the top
 
Posted
Rating:
#26684
Avatar

It's not a good idea to put a new string directly into lang/EN/global.ini because it will get erased whenever you upgrade. However, there's no point adding language strings – we only use them so people may translate ocPortal – but I doubt very much you care about making it so your own website is easy to translate. You can just write text directly:

Code

{+START,BOX,In the {FORUM_NAME*} forum}
   {CONTENT}
{+END}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#26706
Avatar

Community saint

 Surprisingly, that didn't work either.  Here is the full story.  I have put this block into the right side panel. There is no side_forum_topic block, so I just put the main one there to see if it would work - and it did. Then I used Amichan's trick for getting it to show the recent topics from all forums.  The page code looks like this:

Code

[block]side_personal_stats[/block] [block]side_ocf_personal_topics[/block] [block="General Chat, Personal Chef Wannabes, General Kitchen, Equipment, Recipes, Tips & Techniques, General Business, Marketing, Organization, Technology"]main_forum_topics[/block] [block]side_calendar[/block] {$SET,interlock,_false}
 Then I adjusted the template for Block_Main_Forum_Topics to look like this:

{+START,BOX,In the Forums}
   {CONTENT}
{+END}

But it still shows "Active Topics in Technology" (Technology being the last forum listed in the parameters) as the title.  What am I missing?


Last edit: by digigirl
Back to the top
 
Posted
Rating:
#26733
Avatar

Which template did you edit, and have you held down Ctrl+Alt+Shift and refreshed the page to clear the caches?

Back to the top
 
Posted
Rating:
#26735
Avatar

Community saint

I edited the block_main_forum_topics template, and yes I've tried the ctrl+alt+shift refresh multiple times.  No dice.
Back to the top
 
Posted
Rating:
#26769
Avatar

This particular template only takes effect if the forum contains topics. Otherwise a generic template is used. I imagine you won't be using the block live until you have some topics anyway.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#26790
Avatar

Community saint

Aha.  That's probably it, there are no topics in there yet.  Maybe I'll put some in just to test.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: