Hi Gopal!

Yes, you can, but is not necessarily easy:

The solution will have 3 parts:


1.       Implement a Control, maybe by extending an existing control type, for 
example the uuidLink control.
Your custom control will render the radio buttons, as well as 2 hidden divs, 
which are shown via javascript depending on the selected radio-button.
One div will be for internal links, the other for external links. In theory, 
the internal link contents could be rendered using the uuidLink control, and 
the external link contents could be rendered using a normal edit control.

2.       Decide on your storage model. Simplest would be to store the internal 
and external links in separate properties, eg: "linkInternal" or 
"linkExternal". In this case you will need no special save-handlers. Or you 
could decide to store the data in the same property - as long as your 
javascript for part 1 ensures that only one of the controls is "inside" the 
form at a time, this will also require no save-handlers. Problem is then how to 
differentiate the two types of links. You could do like the DAM-image, and 
store this information in its own property, eg linkType="internal" or 
"external". (Personally I consider this a suboptimal design, since we have 2 
fields for one piece of information). Or you could store the link with a 
prefix, like internal:uuid and external:http://www.xyz.com/, but this will 
require a saveHandler.

3.       Implement handling of the links in your paragraphs and templates. 
Everywhere where you use the "combined" link fields, you will need to add 
template logic to first check the link-type, and then render appropriately (ie 
internal links server-absolute with context-path, external links as provided).

I think you will probably find it a lot of work to "retrofit" this 
functionality to the STK templates. If you are using your own templates, give 
it a go. If you are using STK, I would advise against trying this.

Regards from Vienna,

Richard

Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Gopal Kumar
Gesendet: Mittwoch, 08. Juni 2011 15:41
An: Magnolia User-List
Betreff: [magnolia-user] Reg: How to include External Link & Internal Link 
functionality in same tab

Hi All,

I have a situation to add bring up both External Link & Internal Link 
functionality in same tab and as radio buttons, user has to be selected either 
one of it. Full fledged functionality anyone has tried it and successful; I am 
a newbie in Magnolia so need help on this.

I have an idea in the mind but not sure that it will be possible:
[cid:[email protected]]

Can we do as I am thinking... like it is done for Image upload????

Thanks in advance

--
El Nino

________________________________
::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

________________________________
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: 
<[email protected]<mailto:[email protected]>>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

<<inline: image001.png>>

Reply via email to