• WCM 20.03.2012 No Comments

    Actionmenu for WCM

    Here is a code-example of how you can create your own actionmenu with edit, delete and preview-buttons.
    <div>
        <!-- edit -->
        <a href="?wcmAuthoringAction=edit&docid=<%=content.getId().toString()%><%if(content.getId.isDraft()){%>&isdraft=true<%}%>"><img src="edit.gif? /></a>
        <!-- delete -->
        <a href="?wcmAuthoringAction=delete&docid=com.ibm.workplace.wcm.api.WCM_Content/<%=content.getId().toString()%>"><img src="delete.gif /></a>
        <!-- preview -->
        <a href="?urile=wcm%3Apath%3A<%= ws.getPathById(content.getId(), true, true) %>?isprev=true&SRV=Page&CONTENTCACHE=NONE&pcid=<%= content.getId().getId() %>&id=<%= content.getId().getId() %>&WCM_Page.ResetAll=TRUE&CACHE=NONE&CONTENTCACHE=NONE&CONNECTORCACHE=NONE&SRV=Page&page=portlet-page-unique-name" target="_blank"><img src="preview.gif" /></a>                                     
    </div>

    Don´t forget to change the “portlet-page-uniqe-name” to whatever your portlet page is called.

     

    Tags:

  • Diverse 30.01.2012 No Comments

    Eftersom Blocket inte själva skriver ut vad en butik kostar på deras hemsida så har jag tagit reda på det. Så här mycket kostar det 2012-01-30.

    Helår: 8960 kr + moms. Då ingår ett startpaket med 20 annonser gratis.

    Halvår: 4490 kr + moms. Startpaket med 20 annonser ingår gratis.

    Kvartal: 2490 kr + moms. Räknas som “prova-på-paket”, inga gratisannonser ingår.

     

    Att lägga ut annonser kostar sedan 10 kr mer än vad det gör för privatpersoner.

     

    Kan inte fatta varför det ska vara så svårt för Blocket att skriva ut den här informationen på sin hemsida.

     

     

  • WCM 10.01.2012 No Comments

    Normally when you use the UrlCmpnt-tag you will get a mapping-parater in the url.  Like this.

    WCM - UrlCmpnt - mapping parameter

     

     
    If you don’t want the mapping parameter, but want a page parameter instead. Like this.

    WCM UrlCmpnt - page parameter

     

     
    Use this version of the UrlCmpnt.

    <URLCmpnt
    
    context="selected"
    
    id=""
    
    name="mylib/help/start"
    
    type="content"
    
    mode="current"
    
    end="?page=something.pages.authoring.help.startpage"/>

     

  • WCM 09.01.2012 No Comments

    You have to use different tags to get the id of the content link and the content.

    To get the id from the content, use the idcmpnt-tag.

    If you wan’t the id of a content link, use the placeholder tag and use the “tag” Idnum”.

  • WCM 29.12.2011 No Comments

    Do you wonder how you are going to display all content in a menu component? Well here is the answer.
    In the field “Maximum pages to include”, write 0. When you save the menu the number zero is changed to 2147483647. Hopefully thats enough.

    WCM - Max number of content in a view 

  • WCM 14.12.2011 No Comments

    Link to the Element tag ref in infocenter

    Here is an example of the element tag in IBM WCM.
    If you are using the tag in a presentation template for example, use this tag.

    <Element type="content" context="current" key="the-fieldname" />

    If you are using it in a menu och navigator component, change context to autofill.

    <Element type="content" context="autofill" key="the-fieldname" />

    Unfortunately there is no way to add a class for the element when you are using the element tag. I wonder what the developers on IBM was thinking of when then developed this tag.

    <Element type=” ” context=” ” name=” ” key=” ” format=” ” link=” ” separator=” ” htmlencode=” ” awareness=” ” start=” ” end=” ” />
    <Element Opens the tag.
    type=” “ This determines where the element is being referenced from. Either “content“, “sitearea” or “site“.
    context=” “ This determines which content item or site area is being referenced.
    Selected
    Refers to a particular item as specified in the name attribute below.
    Current
    This will reference the element from the current site, site area or content item that is being browsed by the user.
    AutoFill
    The element being referenced will be determined by the search parameters of a menu, navigator or taxonomy component.
    name=” “ Enter the name and library of the item the element is being referenced from. For example, name=”library/item”. To use the library specified in the URL of the current page, use name=”./item”.

    Note:

    • If a content item with the same name is used in more than one site, you can also specify
      name=”library/site/sitearea/item”to select the appropriate content item.
    • If you specify
      name=”./item”, the library name will not appear in your presentation template or element design. The actual path will not be resolved until the item is rendered.

    The “name” parameter is not used if context=current or context=autofill.

    key=” “ This is the name of this element being referenced.
    format=” “ This parameter is optional and can only be used with some element types:
    When referencing an image element:
    Use format=”url” to only render the URL of an image element.
    Use format=”tag” to render a complete image tag. The image will be displayed on the rendered page. This is used by default if no format is specified.
    When referencing a link element:
    Use format=”url” to only render the full URL of a link element.
    Use format=”path” to only render the site path of a link element. For example, site/sitearea/content .
    Use format=”tag” to render a complete link tag. This is used by default if no format is specified.
    When referencing number or date elements:
    In this case, the format is used to specify the display format of dates and numbers. The following formats can be defined when displaying dates:

    • format=”DATE_SHORT”
    • format=”DATE_MEDIUM”
    • format=”DATE_LONG”
    • format=”DATE_FULL”
    • format=”DATE_TIME_SHORT”
    • format=”DATE_TIME_MEDIUM”
    • format=”DATE_TIME_LONG”
    • format=”DATE_TIME_FULL”
    • format=”TIME_SHORT”
    • format=”TIME_MEDIUM”
    • format=”TIME_LONG”
    • format=”TIME_FULL”
    • format=”relative” (The relative date will be displayed as either “today”, “yesterday” or the number of days ago.)

    You can also set user-defined formats for both dates and numbers.

    When referencing user details:
    When formatting user details, the format parameter is used to define which LDAP parameter to use when displaying user details. For example:

    • format=”cn” is used to display the common name.
    • format=”dn” is used to display the distinguished name.
    Maximum character length:
    You can also specify a maximum number of characters to display by using this format:

    • format=”length:number_of_characters

    For example, to display a maximum of ten characters you would specify the following parameter:

    • format=”length:10″
    link=” “ The link parameter is used to define the type of link created by the element tag:
    link=”default”
    A standard link to an element is created.
    link=”path”
    Contextual path linking will be used when rendering this element.
    link=”contextual”
    Contextual content linking will be used when rendering this element. If not applicable, then contextual path linking is used.

    Note: Contextual linking:Contextual linking is used so that when content is linked from another site, the link will be rendered relative to the current site if possible. It can only be used if context=current or context=autofill.

    separator=” “ This only used when referencing an option selection or user selection element. It is used to define what text or code will be rendered between each selection displayed in an option selection or user selection element. For example, to add a line break between each selection, you would use

    separator=”<br>”. If not defined, a comma will be placed between each selection when rendered.

    htmlencode=” “ If htmlencode=”true” the reserved HTML characters in text, short text and option selection elements will be converted into character entities. For example, ‘<’ will be converted to ‘&lt;’. This is useful if you would like to prevent users adding malicious code, or if you want to prevent users changing the look and feel of their text using HTML.

    If not specified, the default setting specified in the

    WCMConfigService.propertiesfile is used. By default, this is set to “true”:

    cmpnt.htmlEncodeDefault=true
    awareness=” “ If awareness=”true” then user names are displayed using the people awareness features. These features displays user names as hyperlinks that allow users to contact people with whom they might want to work. Wherever person links appear, users can click the link to display a menu of actions for collaborating (contacting and working) with the person named by the link. If you, as administrator, have also configured an IBM® Lotus® Sametime® server to work with WebSphere Portal, person links indicate whether a person is active, away, offline, or in a Do Not Disturb state.People awareness will only work in content rendered using either a local or remote rendering portlet.If not specified, then awareness=”false” and people awareness is not used.
    start=” “end=” “ The start and end attributes are used to wrap the data returned by a tag within other tags, such as HTML. These attributes are not mandatory.
    /> This closes the tag.
  • WCM 28.11.2011 No Comments
    Here is a simple example of how to get the Id of an authoring template.
    The example is for IBM WCM.
     
    <%
    Workspace ws = WCM_API.getRepository().getWorkspace(request.getUserPrincipal());
    RenderingContext rc = (RenderingContext) request.getAttribute(Workspace.WCM_RENDERINGCONTEXT_KEY);
    //Workspace ws = rc.getContent().getSourceWorkspace();
    //Workspace ws = (Workspace) request.getAttribute(Workspace.);
    
    DocumentLibrary oldLib = ws.getCurrentDocumentLibrary();
    
    ws.setCurrentDocumentLibrary(ws.getDocumentLibrary("The-Library-Name"));
    
    DocumentIdIterator atiterator = ws.findByName(DocumentTypes.AuthoringTemplate,"Authoring-Template-Name");
    
    if( !atiterator.hasNext()){
    throw new Exception("Couldn't fint the Authoring template");
    }else{
    DocumentId atname = atiterator.nextId();
    out.println(atname.getId());
    }
    %>
    
  • jQuery 15.11.2011 No Comments

    Here is a simple example on how to change the current link to bold when clicking on it. All the other ones are set to plain text.
    Don’t forget to change all the “-signs.

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    body{background:#FFF;}
    </style>
    
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
    $(document).ready(function () {
    $(".x").click(function (){
    //alert($(this).attr("count"));
    $(".x").css("font-weight","normal");
    $(this).css("font-weight","bold");
    });
    });
    </script>
    
    </head>
    <body>
    
    <a class="x" count="10" href="#">10</a>
    <a class ="x" count="20" href="#">20</a>
    <a class ="x" count="30" href="#">30</a>
    
    </body>
    </html>
  • jQuery 11.11.2011 No Comments

    Here is a simple example of how to use the attribute method in jquery. Here is the documentation http://api.jquery.com/attr/

     

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    body{background:#FFF;}
    </style>
    
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
    $(document).ready(function () {
    $(".x").click(function (){
    alert($(this).attr("count"));
    });
    });
    </script>
    
    </head>
    <body>
    
    <a class="x" count="10" href="#">10</a>
    <a class ="x" count="20" href="#">20</a>
    
    </body>
    </html>
    

    Tags:

  • Diverse 21.10.2011 No Comments

    Hittade ett ställe som enligt mitt tycke gör sveriges snyggaste vindflöjlar.

    Tommy Strandberg Collection – Vindflöjlar och Konstsmide

    Kolla in sidan och hitta på en egen cool vindflöjel du också :-)