Need Help Styling Blocks (adding id's, image buttons, etc)
Permalink
I have read the information on blocks in the help section and read other posts but it seems like there is no easy way to change simple things. On the site I am trying to build I want to style the search box, navigation, and create breadcrumbs. I have already given up on a navigation with images in it but it seems like it shouldn't be so hard to style the search box for instance, just a few id's are needed. In my mockup site I have this:
How would I do this with Concrete5?
From what I understand I would have to make a copy of the existing search's view.php file in the blocks folder and then edit that to my liking. I tried this but I kept getting errors when I tried to use it in my template. This makes sense though as I was just trying to feel my way through the PHP. I don't know PHP and I don't have the time or energy to learn it (I am learning Ruby on Rails at the moment).
If anyone smarter than me could enlighten me as to whether or not I am approaching this in the correct way or providing me with an example view.php for the search I would be very happy. I don't want to give up on this because C5 seems really nice but simple changes like this are killing my enthusiasm.
Thanks for any help.
<div id="search-bar"> <form method="post" action="/"> <input type="text" id="search-text" value="Searchhere..."/> <input type="image" id="search-button" src="images/icons/search.png" width="24" height="24" alt="Search" title="Search" /> </form> </div>
How would I do this with Concrete5?
From what I understand I would have to make a copy of the existing search's view.php file in the blocks folder and then edit that to my liking. I tried this but I kept getting errors when I tried to use it in my template. This makes sense though as I was just trying to feel my way through the PHP. I don't know PHP and I don't have the time or energy to learn it (I am learning Ruby on Rails at the moment).
If anyone smarter than me could enlighten me as to whether or not I am approaching this in the correct way or providing me with an example view.php for the search I would be very happy. I don't want to give up on this because C5 seems really nice but simple changes like this are killing my enthusiasm.
Thanks for any help.
Hi, yeah the link you provided was the one that I was checking out before. The link is nice for figuring out what needs to be changed but the how is what gets me. I just thought there might be an easier way to change some aspects of the search, autonav, and other blocks without writing my own custom template that requires knowledge of PHP.
Also mentioning that you guys implemented a few custom templates for the autonav and that the C5 editing screen has its own breadcrumbs kind of leaves me wondering why there isn't a breadcrumbs template included with autonav in the default install (forgive me if it has been included in a newer version, mine is not the newest or that I totally missed it and it is there).
I don't want you to take these comments as negative, I think that C5 is great and I hope that you continue to improve upon it.
Also mentioning that you guys implemented a few custom templates for the autonav and that the C5 editing screen has its own breadcrumbs kind of leaves me wondering why there isn't a breadcrumbs template included with autonav in the default install (forgive me if it has been included in a newer version, mine is not the newest or that I totally missed it and it is there).
I don't want you to take these comments as negative, I think that C5 is great and I hope that you continue to improve upon it.
1) the autonav block is really just a way to spit of a tree of links bracketed in LI tags. Most middleware programmers seems pretty comfortable with doing some css formatting around that. Most of the customization that is going into these templates is simply styling not coding.
2) as you can probably notice from the way our home page is laid out, we believe that building and maintaining websites are two different problems. If you make it easy enough that someone who is really only qualified to maintain a website can completely build it, you're probably crippling what that builder could have done in the first place. (see wordpress)
3) We are a handful of folk in portland oregon with no VC and big dreams. Yes, we have ideas around what the auto-nav block could do in the big picture, but time is money and since most everyone we work with is happy enough paying for the 15 minutes of CSS work it takes to make their nav behave, its just not at the top of our priority list...
all of that being said....
yeah i have ideas about it.
i wish...
o.. the options weren't as confusing as they are.
o.. there were some custom templates that shipped with the core for common elements as you suggest...
o.. the custom template choice wasn't quite as burried as it is (just for this problem, i think it makes sense in the UI once you know its there, but its not great in terms of learning curve..)
oh i also wish that we had better docs and I wasn't answering emails on a sunday morning before getting ready to fly to the east coast to close some more consulting work...
i don't want a pony, but i bet it wont be long before one of my daughters does...
<wink>
-frz
2) as you can probably notice from the way our home page is laid out, we believe that building and maintaining websites are two different problems. If you make it easy enough that someone who is really only qualified to maintain a website can completely build it, you're probably crippling what that builder could have done in the first place. (see wordpress)
3) We are a handful of folk in portland oregon with no VC and big dreams. Yes, we have ideas around what the auto-nav block could do in the big picture, but time is money and since most everyone we work with is happy enough paying for the 15 minutes of CSS work it takes to make their nav behave, its just not at the top of our priority list...
all of that being said....
yeah i have ideas about it.
i wish...
o.. the options weren't as confusing as they are.
o.. there were some custom templates that shipped with the core for common elements as you suggest...
o.. the custom template choice wasn't quite as burried as it is (just for this problem, i think it makes sense in the UI once you know its there, but its not great in terms of learning curve..)
oh i also wish that we had better docs and I wasn't answering emails on a sunday morning before getting ready to fly to the east coast to close some more consulting work...
i don't want a pony, but i bet it wont be long before one of my daughters does...
<wink>
-frz
I think the autonav system is pretty straight forward. I modified it just a little to give each link an ID of it's alias.
Styling it was fun and I think what I have done was pretty cool. Case and point:http://vikingfusion.berry.edu
Look at the menu at the top of the page.
Styling it was fun and I think what I have done was pretty cool. Case and point:http://vikingfusion.berry.edu
Look at the menu at the top of the page.
Hi ijessup,
Nice work! Can you please share the code of how you put id's in the autonav block?
cheers,
Ritch
Nice work! Can you please share the code of how you put id's in the autonav block?
cheers,
Ritch
It certainly wouldn't be the cleanest way, but if you prefer not to tinker with how Concrete5 builds a nav list, you could certainly achieve this with some jQuery.
Just build an on load function that searches a parent div like #header for links inside li's. Then just add the text inside that link as an id or class to the li.
I just woke up and haven't checked the jQuery reference so this code will probably have to be debugged, but it would probably look something like this:
Just build an on load function that searches a parent div like #header for links inside li's. Then just add the text inside that link as an id or class to the li.
I just woke up and haven't checked the jQuery reference so this code will probably have to be debugged, but it would probably look something like this:
<script> function highlight(){ var lists = document.#header.getElementsByTagName("li"); for(var i=0; i<lists.length; i++) { listClass = lists[i].a.text lists[i].className += listClass; break; } } </script>
there's more info here:
http://www.concrete5.org/index.php?cID=2921...
is that the part of the docs you got to that wasn't helping, or did you get into actually changing the way the block itself works?
we certainly don't want you losing any enthusiasm. Like anything there's a learning curve and we've taken the philosophy that it'd be better to give you a nice flexible system that can do anything, rather than some front end powered system that can do 10 navs out of the box but nothing else...
the reality is, the autonav block needs to move somewhat more towards the click and enjoy world without limiting what a programmer can do..