Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Remove directory in path
briggek8717
Hopefully this is an easy answer, but I've been staring at it all day and can't figure it out. When our users add an image using VFE, the path it returns always has /docroot at the beginning of it. Well, they always have to remove that /docroot in order for the image to display correctly. Is there a way for me to remove it for them?
I've been going through all the javascript files and I can't seem to find what controls the screen that does the image selection. I'd like to catch the path that it returns just prior to it displaying it in the "File Selection" box on the screen and strip out the /docroot.
We're on Teamsite 6.1 on Windows 2K3.
Find more posts tagged with
Comments
Migrateduser
That's a common requirement, but who cares if it says /docroot in the DCT? Having FormAPI strip out the leading /docroot onSave is a common solution.
Current Environments:
(1,2) TS 6.5 on W2K3
(3) Vignette V7 Portal on Solaris 9
briggek8717
I see where you are going with that, but when I implement it that way, the user will have a hard time previewing or resizing a red "x". Knowing my users, they aren't going to want to navigate to their image, insert the red "x", hit save (image now appears), then go back into the image editor to resize it to fit correctly, and save again. Is there any other way?
kshitiz
Why don't you hadle the onChange event on that item (through FormAPI) and remove the
/docroot
string from its value. Its not a tried solution but a recommendation if it works.
Kshitiz Sharma
BT Wholesale | CMS
Mahindra British Telecom
briggek8717
The onChange would give me the same issue that the onSave would have as well. The user would still have had to select their image, not be able to preview it, insert it, and then go back in to make any changes.
I finally dug through enough documentation from ektron and found where the path gets sent back to the window. In case anyone else needs this capability, this is what I had to do (It was painfully simple once I found the code).
In ewep.js, I just had to add first line in the function to replace /docroot. That did it for me.
function eWebEditProInstance_insertMediaFile(strSrcFileLocation,bLocalFile,strFileTitle,strFileType,nWidth,nHeight){
strSrcFileLocation = strSrcFileLocation.replace(/\/docroot/, '');
setTimeout('eWebEditPro.instances["' + this.name +'"].insertMediaFileDeferred(' + toLiteral(strSrcFileLocation) +', ' + bLocalFile +', ' + toLiteral(strFileTitle) +', ' + toLiteral(strFileType) +', ' + nWidth +', ' + nHeight +')',1);
}
gcmartin
That's awesome! Been hacking my way around this issue as well, much cleaner approach.
Best Regards,
GM