• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Design decision for a mostly static page

 
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The landing page at permies is mostly static (http://permies.com/). I use a little embedded server side code to add partials and some code to parse through a yaml file that has a list of items that are then automatically added to the moichendize section (http://permies.com/#moichendize).

Now, we want to add the following behaviour to the forum category icons (https://dl.dropboxusercontent.com/u/4668499/permies/hoverover/index5.html). I am wondering if I should just hard code it in html or use the yaml strategy again. Thoughts?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you want to get the server involved in what appears to be a purely CSS operation?
 
Adrien Lapointe
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, I did not express myself very well.

Right now, the list of forums is hardcoded in html. What I was wondering was if it would be a better idea to put the list in yaml file and get the server to parse the list and generate the html. Is it clearer?
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess I'm missing some context here.

What do you mean by "parsing" the list - the thing you want the server do?

Since the forum list is all static, what kind of parsing would you want the server code do for it?
 
Devaka Cooray
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK I read about it again, it looks like you are trying to have a .yaml file which contains information about the forums and then you make the server generate the HTML based on that, right?

Hmm, I still wouldn't feel like it worth the efforts unless there's a good number of forums, or the forum information is subject to change often.
 
Adrien Lapointe
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right now, for the products, I have a list in yaml that looks like this:



I have a bit of code on the server side to go through the list and generate something like this:



That allowed me to write the html for each items once, which makes it easy to maintain, and since the list changes often enough that it would be a pain to always modify the html, I think that solution works well enough.

Now, I am wondering if I should take the same approach for the forum categories. Those do change, but not very often. I feel like it will be a pain to just do copy and paste for each categories, and if we decide to change the look, it will need to change the html for each categories. Not a very DRY solution in my mind, but doing that processing is more load for the server.
 
Adrien Lapointe
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Devaka Cooray wrote:OK I read about it again, it looks like you are trying to have a .yaml file which contains information about the forums and then you make the server generate the HTML based on that, right?



yes, that is what I am thinking of doing.


Hmm, I still wouldn't feel like it worth the efforts unless there's a good number of forums, or the forum information is subject to change often.



So you think the best approach is just to copy and paste the html for each category and change the text and link in there?
 
Devaka Cooray
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adrien Lapointe wrote:

Hmm, I still wouldn't feel like it worth the efforts unless there's a good number of forums, or the forum information is subject to change often.


So you think the best approach is just to copy and paste the html for each category and change the text and link in there?



The idea of dynamic loading of the forum names is good and it would be a way to go if you have tons of forums, or the forum data tends to change so often. That approach would make the maintenance easier. Even if implementing it takes about 20 minutes, you could still save about several hours of maintenance efforts over a couple of months (or years).

Right now you have only 12 forums. And each forum has only two <div> elements. When something in the HTML mock up changes, I guess it would take about less than a few seconds to change the all 12 elements. Plus, if the forums don't change so often, I don't think it worth the efforts to worry about it.

If your concern is about repeating HTML elements, you might want to use included JSP files (or tag files), which would be a lot easier to pull off than having to parse a yaml file.
 
Adrien Lapointe
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I didn't know about the tag files, I am still very new to the jsp thing, and haven't much time to learn it well. I just hack at it.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How often does the list change?
 
Adrien Lapointe
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the past the categories were pretty much fixed, I think we might add categories a few times a year now, maybe.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then I wouldn't bother with automating it.
 
Adrien Lapointe
Ranch Hand
Posts: 346
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies, I will go with the tag files.
 
reply
    Bookmark Topic Watch Topic
  • New Topic