Log in

No account? Create an account
Component Tips and Tricks
20 entries back

Date:2003-09-26 15:04
Subject:Override blitz...

Ok time to further my exploration of s2 and mangling of component :) *chuckle*

I wanted to be able to have two "different" kind of entries on my Recent and Day view...
I wanted to be able to format an entry where the title ends up in the top area instead of the date/time and remove things like the user icon and the like (for announcements, see http://www.livejournal.com/users/aelana at the top -- the welcome message is a forward-dated message that is set using the code below to an announcemnt).
The other was a hidden entry that doesn't show up on the recent or day views, but can be linked to explicitly.

While musing about how to code this I noticed in xevinx's journal that he was thinking about doing it by date but that didn't seem right or generic enough for me (i want to be able to randomly do them throughout my journal not just at the top and bottom)... so I settled on doing it based on two special moods...

The code below overwrites the print_entry function in the RecentPage and DayPage (and FriendsPage, just to change it back for the Friends Page) so that if an entry has the mood "special/announcement" it is formatted like an announcement, and if it is "special/hidden" it hides it... if you tack "?.unmask=true" it will display all the events "normally" (so you can do things like find out links for hidden entries, etc)...


(note - I couldn't override in the ReplyPage and EntryPage for some reason, so this formatting does not carry over to those... also your friends will not see the special formatting, so changes are you will want to set backdate on entries that you do this to so it doesnt go to their friends' pages)
(also note - this does not do anything with poster name etc, so it may need tweaking for community and shared journal use - or not depending on who/why you want to use it)

click here for the overrides - these should be put in a custom themeCollapse )

22 comments | post a comment

Date:2003-09-25 10:07
Subject:How to give yourself an error page...

I have a Default View on friends list that is empty and various friends groups that I read... I wanted to be able to alert people to this fact if they try to go to my friends page.
Another possible reason for this is to allert people to a friends only journal (i.e. going to the LastN page with no entries)

One way that works for the LastN page is a far distant past post that is publicly viewable, but that does not work for the Friends page because friends page only will show posts posted (not date on post) within the last two weeks.

So I did was overrid RecentPage:print and check for size $.entries of 0 (no entries) if not call page_layout if so display my erorr... and poof instant error page...

(note you have to create a custom theme, look at previous posts in this communitiy if you need a tutorial on that)..

Code to add to your custom themeCollapse )

55 comments | post a comment

Date:2003-09-18 19:20
Subject:official notice

Officially we are leaving (Page p) in the print_free_text(Page p) function.
All my tutorials have been updated to represent the changes.
Those that have already added Page p will not have to do anything.
Those that were waiting for it to be reverted should modify their layer.

Once again, sorry about the confusion.

17 comments | post a comment

Date:2003-09-12 08:19

Due to my mistake of making

function print_free_text(Page p) {

A lot of people are getting error compiling layers, or are missing free_text components.

To fix, change:
function print_free_text();

function print_free_text(Page p);

and if you have
var Page p = get_page();

(which you would if you did the update journal component), get rid of it.

however, as soon as this latest update goes through, you'll need to change it back...

19 comments | post a comment

Date:2003-09-11 16:00
Subject:more updates

changes went live.

the use of "em" didn't go over well. some people were getting really large text, some were getting really small text. the differences between using the Component setting of "small", "normal", "large", etc and using IE's Text Size setting "smaller", "small", "medium" etc were being confused. General chaos continued, cats were marrying dogs, rain come up from the ground, etc.

So, for the time being, font sizes have been moved back to "px". The question is, does it still need to change to "em" since users can now can enable the View comment pages in your journal style? option in your personal information? Any suggestions on font handling that would minimize the number of broken styles? I'd especially like to hear from other web developers.

Also, print_free_text(Page p) has been changed back to pring_free_text() so that it wont break your layers anymore. My bad...I'm sorry...

Finally, because of the change back to pixel, $base_font is still available, but does nothing at the moment. If you're using it in a layer, I recommend removing it in case base_font is completely removed in the future (which might be the case if the fonts stay with px).

28 comments | post a comment

Date:2003-09-09 16:07
Subject:Big Update

I had to update some code, so I thought I'd squeeze in a few fixes and changes. What I really need now is some people to test it. I can't stress how much easier it is to fix things while they're in testing than on the live server. If you have issues, its best to identify them on the test server. With that, I ask that if you have time, go set up an account on the test server and test out Component. Any account set up on the test server has Paid Member status, so you wont have to buy an account to test out Component. ( The test server is free to use at any time for testing, but testing only. Journals found being used for purposes other than testing are subject to deletion without notification. )

That being said, here is the list of changes made:


Updates made:

Added property for customizing form elements. It can be found at the bottom of the Presentation tab. If set to true, select, input, and textareas will be set to your journal colors. If set to false, it will use standard default settings. Along these lines, I also added color to the font (it was not applying previously) in the select menu if form customization is on.

Added better support and integration into the design for multiple page comments.

Changed print_free_text() function to print_free_text(Page p) and passed the page to it through all places that call the print_free_text funtion.

Changed "Read Comments" link from .permalink_url to .read_url

Added to the customize interface the ability to change what the Mood says (instead of "Current Mood").

Added to the customize interface the ability to change what the Music says (instead of "Current Music").

Added ability to change the permalink text (instead of "Link");

Centered userpics.

Change alt tags on userpics to be specific to the poster.

Added "line-height: normal" to the header tags since they tend to overlap with smaller line-height settings.

Changed font handling...no longer uses "px", now uses "em". Small = .65em, Normal = .7em, Large = .8em, Larget = .9em, Hulk = 1.1em

Added a property called $*base_font that is not visible in the customize interface, but can be modified through a user/theme layer. It is for setting the em manually.

Added Next and Previous links to EntryPage (the page you see all the comments on)

Added Next and Previous links to the DayPage

Added Next and Previous links to the ReplyPage (the page that has the form to reply to an entry on)


I wish I could have gotten to more, but time was running out. Please, if you can, test out those changes and make sure they work like you expected them to. A lot of them were made because of feedback/reports/suggestions here. Thanks.

Also note that the User Info for this community has been updated with an FAQ. I removed some comments that no longer needed to be there because of the FAQ, or have been addressed in this list of changes.

Thanks again!

27 comments | post a comment

Date:2003-09-01 11:18
Subject:New Trick - Update Journal Component

Placed here is the code to add a component that has the necessary values for posting to your journal. I thought it would be most useful for communities that want to use Component. This was, when a member is on the community page, they can fill out the update form and post to the community, without having to leave the page. To see a sample of what it is like, take a look on my journal (xevinx).

I've included some settings for your modification:

The time_difference is the difference between your current time and livejournal's system 2 time, which uses GMT. This just checks the hour, so mine is -7, for -700.

Sidenote: If any programmers want to check over all that code for the date and time handling, I'd appreciate it, thanks.

Change the journal variable to the journal you want this form to post to. If it is a community, it also uses this value to generate the "join" link.

By setting the community variable to true, it adds the link to join the community.

If you want the text input boxes for the date and time to appear, set the show_date variable to true.

The title variable is what is entered for the title of the component that the update form is in.

Before continuing, you should be familiar with making a custom theme layer and modifying the contents of the free_text function as described here

Okay, now copy and paste the following code into your free_text function. Make sure to change your user settings after pasting. It is currently set up to post to my anomalies community.

the codeCollapse )

47 comments | post a comment

Date:2003-08-28 03:44
Subject:New Component Version

Hello, wanted to let you know that there is now a new version of Component on the live server. It came with a number of other server changes that had to happen first. It doesn't address all the issues and requests that have been brought forward in this community since it is a version that was before this community existed. However, there are a number of new things that are fixed or modified now. Mainly you'll see the results in the customization area. Here they are as I remember them:

  • NO MORE "PERSONAL"! I'm glad this finally went through because it is the most complained about element of Component. The journal type will no longer appear in the Profile Component. It's all up to you to add it if you want it. Most people don't.

  • Font Family now appears in the customization UI.

  • Line Height now appears in the customization UI.

  • Links is totally different. Links are now supported by LiveJournal, and not just the Component style. Links will no longer appear in the customization UI, but at http://www.livejournal.com/manage/links.bml . This is so that no matter what style you choose (assuming it supports links), you wont lose your links.

  • With the additional support for Links, I was able to get rid of the often seen trailing line at the bottom of the links component.

  • some other general code clean up.

So, if you notice anything wrong, let me know. Unless anyone objects to it, I'm going to clean out some of the comments in the requests/suggestions/errors that no longer apply...just to keep things clean.

59 comments | post a comment

Date:2003-08-24 13:49
Subject:Override the stylesheet.

Overwriting the Stylesheet.

This tutorial is no longer recommended since it is no longer required to overwrite the entire stylesheet to add/modify elements of it. please see this post for how to do it more efficiently.

As a note, this will most likely become obsolete in the future. I plan on adding a new blank function that appends itself to the end of the stylesheet. That was you can just add on to it whatever you want to do (scrollbars, etc) and not have to print out the entire stylesheet. This is how the new style "The Boxer" (on the test server) is done (with the function appended_to_stylesheet). However, I don't know when the new Component code is going to go to the live server, and even then, I'm not adding anything until after that. So in the meantime, I'm providing this.

This assumes that you are already familiar with creating your own custom themes or hand coding a user layer (I recommend the theme). If you are not, please see this post.

the meatCollapse )

42 comments | post a comment

Date:2003-08-19 14:43
Subject:At xevinx's request
Mood: hungry

I've modified my mini calendar so that circles appear instead of the normal rectangles for the calendar days and xevinx requested that I explain how I did it here. :) I've left the locations for the images I used in my code so you can examine them, but I'd appreciate it if you use your own images instead of using mine to keep down my bandwidth.

Here's how I did itCollapse )

Speaking of the mini calendar, would it be possible to make a mini calendar function available in the core layer so people can have ones with javascript and iframes in original layouts?

41 comments | post a comment

Date:2003-08-18 01:57
Subject:Additional Component customization

[ originally posted here, moved here, but still some comments there ]

I so did not go over this to see how much it makes sense, so let me know how it turns out

oh yeah, and propz to mart for making me realize that this can even be done. i honestly am not that great of a programmer.

This has been requested a lot, so I thought I'd post it here for everyone to find. This is an overview of how to further customize Component with additional components or HTML that otherwise couldn't be entered. I want to give a warning though, Component was designed to maximize flexibility and customization to the average non programmer. It allows for a lot of customization without the loss of design integrity. Using the instructions below can potentially screw up the layout. It is easily undone though. Just a warning. Ugly things may lie ahead.

How to further customize componentCollapse )

170 comments | post a comment

Date:2012-01-01 01:02

Please report any bugs or errors that you have received or discovered as a comment to this entry. Thank you. Please skim through the comments here to see if what you are reporting has already been addressed.

57 comments | post a comment

Date:2011-01-01 01:01

Please place all suggestions for new Component features or changes as a comment to this entry. Thank you.

56 comments | post a comment

Date:2010-01-01 01:01

Please place general feedback as a comment to this entry. This includes everything other than bug reports/errors and suggestions. Thanks.

30 comments | post a comment

my journal