|A Guide to Supporting in Embedding
||[Feb. 15th, 2004|01:28 pm]
AngelSK's Support Docs
Disclaimer: this is not an official document. It was created by a volunteer who does not have Supporthelp in Embedding
A Guide to Supporting in Embedding
* Embedding FAQs | S2 FAQs
* Getting Started in Embedding
* Embedding Developer Documentation
* Guide to customview.cgi (S1)
* support_links Embedding Section
Please see Getting Started in Embedding for basic information on embedding in S1. The different methods of embedding can be found on the Developers Page. Embedding is mainly a Paid Account benefit, however, Free Accounts can embed using the Frames method. When a Paid Account expires, and it is using the customview.cgi method to embed, the embedding will stop working as the customview.cgi will no longer work.
FAQ 68 explains Embedding. FAQ 147 explains how to show Friends-Only and Private entries in an embedded journal. FAQ 146 explains how to change the appearance of your embedded journal. This is especially useful when people are using style101 and complain about having no comment links, and hard coded colours. You can browse system styles by using the Styles Browser and searching for "system" or "bradfitz".
It is possible to embed any of the four journal views (Recent Entries, Friends, Calendar, or Day) into a website. The customview.cgi script will display the appropriate view for the style it is displaying; in a customview.cgi URL (such as http://www.livejournal.com/customview.cgi?username=exampleusername&styleid=12345 or http://www.livejournal.com/customview.cgi?username=exampleusername&styleid=12345&enc=js), using the style ID number of a Calendar view style will display your calendar page. You will need to create separate styles for each view that you want to embed. You will also want to then edit the style used for your embedded journal, replacing (for example) %%urlcalendar%% with the URL of your customised page.
You cannot request a specific entry from customview.cgi. However, it is possible to embed the day view using customview.cgi, as explained in this "HowTo" entry. Alternatively, you can embed the entry directly by replacing the URL of customview.cgi with the URL of the entry in the embedding code. This will appear in the LiveJournal system scheme. For a mostly text version, you may wish to use the lynx scheme to view the entry by adding ?usescheme to the URL - e.g. http://www.livejournal.con/users/exampleusername/123.html?usescheme=lynx.
It is possible to display older entries using customview.cgi by passing in a skip parameter; for example, http://www.livejournal.com/customview.cgi?username=exampleusername&styleid=12345&enc=js&skip=5 displays 5 entries back from your journal. More information about the parameters you can use with customview.cgi is available from the customview.cgi "HowTo" entry. However, none of the parameters for the skiplinks variables give you access to the number of entries which need to be skipped over (%%numitems%% indicates the number of items skipped in a single step and will always be the same - 3 in this case). In order to link back to an embedded version of your older entries, you will need to write your own code to read a skip parameter on your embedded page, pass it to customview.cgi and generate the correct links to navigate back and forward. LiveJournal support cannot provide assistance in writing such code.
This post in lj_nifty shows how to construct a customview.cgi URL for a Custom Friends Group filter. Specifically, the URL will be: http://www.livejournal.com/customview.cgi?styleid=12345&user=exampleusername&nooverride=1&checkcookies=1&filter=0. The filter=0 attribute will need to be changed according to the following scheme. Go to the Friends > Filter page and look at your Custom Friends Groups. Check the boxes next to the groups you are interested in showing and click the "View!" button. The URL for the page that comes next will include the filter setting you wish to use.
Random technical note for ASP Embedding: "Response.CodePage = 65001", sets it to UTF-8 encoding.
There is no equivalent to customview.cgi for embedding journals in S2. You should replace instances of the following:
http://www.livejournal.com/customview.cgi?username=exampleusername&styleid=101, with either the URL of your journal; or if you want a different style on your embedded journal, with:
http://www.livejournal.com/users/exampleusername/?s2id=1234, with 1234 being the style ID for your S2 style. Please note that there are currently no equivalents of &enc=js or &checkcookies=1 available for this method.
You can have customised embedded entry pages with S2. If you wish to view an entry in your own custom designed style, you can create your own style for the entry pages. If you wish to create a style specifically for embedding and not apply it to your journal on LiveJournal, then you can specify the ?s2id parameter in the URL of the entry you wish to embed - e.g. http://www.livejournal.con/users/exampleusername/123.html?s2id=1234.
FAQs to reference for S2: 170 (Customising with S2) and 172 (Creating a Custom S2 Style). You should edit custom styles to include the ?s2id argument if you wish all the embedded pages to display in the same style.