Gossamer Forum
Home : Products : Links 2.0 : Customization :

Edit links.css in Admin

Quote Reply
Edit links.css in Admin
Hello,
Someone requested a mod that allowed the css file to be editied in the ADMIN. I have composed detailed instructions on how to complete this.I did not test the MOD out so i cannot guarantee that it works. You can view it at http://www.netoo.phiberoptix.com/links/links-css.shtml .

Jimz
Quote Reply
Re: Edit links.css in Admin In reply to
The following comments represent my "personal opinion" only.

I, for one, would not even consider trying to use a mod that was untested by the author. The way I see it, if it is such a great mod, the author not only has tested it, but uses it him/herself.

This is not to say that your mod does not work or that it isn't worth looking at. I just am cautious about using something when the person who wrote it doesn't use it and hasn't even tested it. Even though I use and test all the mods I write, there are still "bugs" found from time to time, despite most of my mods being in use for many weeks before I publish the instructions. How many bugs would there be in a untested mod?
Quote Reply
Re: Edit links.css in Admin In reply to
Ok, I will test it. The only problem is i dont use css files so it would be kinda hard to test. I will do my best tho.

------------------
Quote Reply
Re: Edit links.css in Admin In reply to
I have a question regarding css, so I thought I'd ask it here since you are already on the subject. Do I have to use it at all. Can I design my pages strictly with html? I would prefer this, due to browser problems with css but since I am just getting started, I am not sure.

------------------
Mollypot
http://www.mollypot.com
Quote Reply
Re: Edit links.css in Admin In reply to
No you don't have to use css, in fact you can delete the file if you really want to. It wont affect the pages.



------------------
Joker
Concepts 2000 Online
www.concepts2000.com
tech@concepts2000.com

Quote Reply
Re: Edit links.css in Admin In reply to
If I delete the css, how do I customize the fonts for the different portions of the site? i.e. fonts, color, etc.... could i specify these for the links separately? in that case, can I specify different settings for each factor as does the css but without the style sheet?
Quote Reply
Re: Edit links.css in Admin In reply to
You can do it the way it was done in Links v1, by putting predefined font variables near the top of site_html.pl. Links v1 used the following variables:

Quote:
$font_new = 'font face="arial, helvetica" size=2 color="#CC0000"';
$font_pop = 'font face="arial, helvetica" size=2 color="#000000"';
$font_date = 'font face="arial, helvetica" size=1 color="#000000"';
$font_title = 'font face="arial, helvetica" size=4 color="#000000"';
$font_subtitle = 'font face="arial, helvetica" size=3 color="#000000"';
$font_menu = 'font face="verdana, arial" size=1 color="#000000"';
$font_link = 'font face="arial, helvetica" size=2 color="#000000"';
$font_category = 'font face="arial, helvetica" size=2 color="#000000"';
$font = 'font face="arial, helvetica" size=2 color="#000000"';

Then, in any of the site_html.pl subroutines, you can use, for example, <$font_category> .. </font> where you want the font to be used.

If you want to do that with templates, then in the %globals variable, add the following code to the top of the list of other variables provided in %globals:

Quote:
font_new => qq|<font face="arial, helvetica" size=2 color="#CC0000">|,
font_pop => qq|<font face="arial, helvetica" size=2 color="#000000">|,
font_date => qq|<font face="arial, helvetica" size=1 color="#000000">|,
font_title => qq|<font face="arial, helvetica" size=4 color="#000000">|,
font_subtitle => qq|<font face="arial, helvetica" size=3 color="#000000">|,
font_menu => qq}>font face="verdana, arial" size=1 color="#000000">|,
font_link => qq|<font face="arial, helvetica" size=2 color="#000000">|,
font_category => qq|<font face="arial, helvetica" size=2 color="#000000">|,
font => qq|<font face="arial, helvetica" size=2 color="#000000">|,

Then, in the templates when you want to use a font for something, say a category list, you can use <%font_category%> where you want the font and </font> to end its use.

Of course, you can eliminate all of this type of stuff just by putting <font></font> tags directly into the HTML of site_html.pl or in the template files themselves.

I hope this helps.

[This message has been edited by Bobsie (edited June 04, 1999).]
Quote Reply
Re: Edit links.css in Admin In reply to
Thank you so much for your reply. Many of my users are from aol and webtv and I don't want to loose them.


------------------
Mollypot
http://www.mollypot.com
Quote Reply
Re: Edit links.css in Admin In reply to
You might also want to browse around http://developer.webtv.net/ for more about WebTV development.
Quote Reply
Re: Edit links.css in Admin In reply to
Hi,

I hope people are still looking at this topic.I will post my question here because it is about the css.

I want to edit my site but i can't get the colors right through the css file. Now i want to use the method described above.

Must i remove the next line from my templates?

<link rel=stylesheet href="<%css%>" type="text/css" title="style sheet">

And can i add bgcolors to the code above like this?
-->ex. $font_menu = 'font face="verdana, arial" size=3 color="#000000" bgcolor=#000040';

I hope someone will help me out to make my site look good.

Thanks,
KB
Quote Reply
Re: Edit links.css in Admin In reply to
KB,

Yes, you should remove the line you noted above. Then just go through and edit your templates like regular HTML files, making sure you keep all the <%Tags%> in there... although you may reorder them to suit you. There's no reason to set up variables to hold colors. Just put in your fonts and colors as you would in a plain HTML page.

Hope this helps.
Phoenix
Quote Reply
Re: [Jimz] Edit links.css in Admin In reply to
is this mod still around?

I use templates due to the various modifications I've added and it's a pain to edit the templates via the admin.cgi, then have to upload the .css file using ftp - would be great if I could do it all through admin.cgi. Wink

I tried adding links.css as a new template, then changed the line in links.cfg to get the $build_css_url pointing to the templates folder, and while it did build, none of the css came out on my site.

any ideas on how to edit the css file through the templates in admin.cgi?

many thanks in advance
-Kristen
Quote Reply
Re: [13thhour] Edit links.css in Admin In reply to
What's the source code of your index.html file? In particular, what is the CSS reference code look like?
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Edit links.css in Admin In reply to
Do you mean..?

Quote:
<link rel=stylesheet href="<%css%>" type="text/css" title="style sheet">


It was because I am using the %css% tag that I thought I might be able to alter the links.cfg

$build_css_url = $build_root_url . "/links.css"; # URL to your CSS file.

to something like

$build_css_url = $db_template_path . "/links.css"; # URL to your CSS file.

but no luck.
Quote Reply
Re: [13thhour] Edit links.css in Admin In reply to
And do you have the following global tag definition in your %globals hash in the site_html_templates.pl file?

css => $build_css_url

And if so, did you rebuild after making the changes in your links.cfg file? If not, add the global tag and it should work.

Buh bye!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Edit links.css in Admin In reply to
yep - did all that, everything is in place.. but it's still not working!
Quote Reply
Re: [13thhour] Edit links.css in Admin In reply to
Well, one problem is that the CSS file is in your templates folder that is password protected.

One thing you could do is create an "embedded" included set of CSS style codes and then use:

<%include css.inc%>

in your template file.

RATHER than using a CSS file.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Edit links.css in Admin In reply to
I've never used that code before - but along the same lines I was inspired to do it via the mod I was already using for includes:

<STYLE TYPE="text/css">
<%include links.css%>
</STYLE>

It works (yay!), but I don't really like having all the css printed out into the source like that though.

many thanks!
-Kristen.
Quote Reply
Re: [13thhour] Edit links.css in Admin In reply to
Well, one thing you could do is use HEADERS and FOOTERS in your script. Put all your HEADER codes in the header file, then in your template files (except for link.html) file, you would use:

<%include header.inc%>
<%include footer.inc%>

Then in the header.inc file, you would use

<%include css.inc%>

to call the CSS code.

Basically, the same result will happen with the embedded CSS codes printed in the HEADER portion of your web pages, but you only have to edit the HEADER file once or just edit the CSS file.

Buh bye!
========================================
Buh Bye!

Cheers,
Me