Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kate 267 posts 610 karma points
    Sep 12, 2010 @ 15:28
    Kate
    0

    Creating a <a hef="" >

    Hi

    <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Arial","sans-serif"; mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:"Times New Roman"; mso-ansi-language:DA; mso-fareast-language:DA;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} -->

    I would like to make a macro that can create a link: <a href=""> </ a>
    In content, the user himself should be able to enter text and then choose a location for the link.
    I would like if it could work in the same way as when I make a link from inside a Richtext editor

     

    Can anybody help me with that?

    I have umbraco 4.5.2 installed

  • Sascha Wolter 615 posts 1101 karma points
    Sep 12, 2010 @ 22:58
    Sascha Wolter
    0

    Hi Kate,

    you could for instance create two new properties for that document type, e.g.:

    'linkText' of type textbox
    'link' of type content picker

    Then in the macro you can write the following:

    <a href="{umbraco.library:NiceUrl($currentPage/link)}">
      <xsl:value-of select="$currentPage/linkText" />
    </a>

    You can also use another textbox for the link to enable external links, or check out the related links datatype especially if you want to allow the user to select multiple links.

    Hope that helps,

    Sascha

     

  • Kate 267 posts 610 karma points
    Sep 20, 2010 @ 08:42
    Kate
    0

    Thanks, just what I needed

Please Sign in or register to post replies

Write your reply to:

Draft