Welcome to Pintexx Forum Sign in | Join | Faq

pinEdit

Started by sfi_dev at 08-02-2011 1:29 . Topic has 14 replies.

Print Search
Sort Posts:    
   08-02-2011, 1:29
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hi there,

We need to be able to enter just the image name for url's or server images because the url will be different from client to client.

So as a test I have set a base referenece image -
pinEdit1.BaseReferenceImage = "http://website/portal/images/"

pinEdit1.EditInsertHtml ("<img alt='' src='banner.gif' align='baseline' border='0' />")

So I would expect the following image to display "http://website/portal/images/bannger.gif"

What is happening instead is that an incorrect url reference is being added to the inserted HTML as follows
<img alt="" src="http://website/portal/editor/banner.gif" align="baseline" border="0">

How do I reference the right path of the image WITHOUT it appearing in the HTML e.g. I want the final HTML to be:

<img alt="" src="banner.gif" align="baseline" border="0">

I am using Pinedit Activex 7.1.0.1106

Kind Regards

sfi_dev
   Report 
   08-02-2011, 8:14
Pintexx Support is not online. Last active: 12.01.2012 07:36:39 Pintexx Support

Top 10 Posts
Joined on 08-30-2005
Posts 1.914
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hello,

the BaseReferenceImage works only with dfile references as you have the desktop version

I recommend using the "base" tag and the href attribute.
You can add this dynamically by using DOM with editor.document.

Regards,
Hans-Peter
   Report 
   08-02-2011, 8:52
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hi there,

Thanks for the recommendation.

Is there some sample syntax.. I am not to experienced with DOM.. is it something like

Dim doc As mshtml.HTMLObjectElement
Set doc = pinEdit1.document
doc.BaseHref = "http://website/sfiportal/images/"

I do get an error on doc.basehref so my syntax is obviously not correct.

Thank-you.

   Report 
   08-04-2011, 2:00
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hi Support,

I am struggling with setting the base href programatically with DOM. Is there an example I can start with.

Thanks in advance.
   Report 
   08-04-2011, 2:08
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
I should have posted the code sorry:

Here is the code:
Dim doc As mshtml.HTMLDocument
Set doc = pinEdit1.document
link = "http://venus/sfiportal/images/"
Set abc = doc.documentElement
s = abc.setAttribute("base href", link)
pinEdit1.EditInsertHtml ("<img alt='' src='banner.gif' align='baseline' border='0' />")

Here is the result:





<img alt="" src="http://venus/sfiportal/editor/banner.gif" align="baseline" border="0" />



As you can see the src= still contains the full path... I need it to just be src="banner.gif"

Thanks in advance.
   Report 
   08-04-2011, 8:17
Pintexx Support is not online. Last active: 12.01.2012 07:36:39 Pintexx Support

Top 10 Posts
Joined on 08-30-2005
Posts 1.914
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hello,

if you have add the base tag correctly you should see in HTML view.

It should look like this:
head tag
base href="http://www.xxx,comm/images/"
head tag

You have to create a new base tag with DOM createelement and add it to the head tag with appendChild. Then you have to set the href attribute.

You can also load a prepared HTML string first that contains the base href and insert the image to test.

Regards,
Hans-Peter

   Report 
   08-04-2011, 9:10
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hi there,

editinserthtml still inserts the full path. The creating of the base href is correct. I need the editinserthtml to not add the full path but it generates it automatically even though you can see the src="banner2.gig" the full path is created.

I have the following code:

Dim link As Object
Dim ni As Object

Set doc = pinEdit1.document
Set link = doc.createElement("base")
link.setAttribute "href", "http://venus/sfiportal/images/"
Set ni = doc.getElementsByTagName("head").Item(0)
s = ni.insertBefore(link, ni.firstChild)

pinEdit1.EditInsertHtml ("<img alt='' src='banner2.gif' align='baseline' border='0' />")

The result is:







<img alt="" src="http://venus/sfiportal/images/banner2.gif" align="baseline" border="0" />


   Report 
   08-05-2011, 5:34
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Ok so here is my issue. When I use editor.editinserthtml ("<img alt='' src='banner.gif' align='baseline' border='0' />")

It is inserting the text with the full path of base href:
("<img alt='' src='http://venus/sfiportal/signatures/banner.gif' align='baseline' border='0' />")

Before I use editor.editinserthtml I create the base href successfully using the following code:
Dim doc As MSHTML.HTMLDocument
Dim ohref As Object
Dim node As Object
url = "http://venus/sfiportal/Signatures/"
Set doc = pinEdit1.document

' remove the base tag and re-add incase the url has changed
Set node = doc.getElementsByTagName("base").Item(0)
ni.removeNode

Set ohref = doc.createElement("base")
ohref.setAttribute "href", url
Set node = doc.getElementsByTagName("head").Item(0)
s = node.insertBefore(ohref, node.firstChild)

The result of this is (note: I have removed the <> around the tags because it was not inserting in this message window)
html
head
base href="http://venus/sfiportal/Signatures/"
/base
title /title
/head
body
<img alt="" src="http://venus/sfiportal/Signatures/banner.gif" align="baseline" border="0" />
/body
/html

How do I get it so that the scr image does not insert the url of the image. I am not in the editinserthtml statement, the editor just seems to be inserting it. bug??. I need to be able to save the document away without the full path in the image src.
   Report 
   08-06-2011, 5:21
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hi Support,

Are you able to respond to my message above so I can move forward.

Thanks in advance.
   Report 
   08-09-2011, 2:53
Mordy is not online. Last active: 09.08.2011 11:53:25 Mordy

Top 75 Posts
Joined on 04-29-2010
Posts 10
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Was a solution found for this? I'm experiencing the same issue at the moment.
   Report 
   08-10-2011, 12:23
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
hi mordy, nothing as yet. I have also emailed support so if/when I get a response I will post back. This is a big issue for us because we save system templates that need to be url dependent.
   Report 
   08-10-2011, 11:44
Mordy is not online. Last active: 09.08.2011 11:53:25 Mordy

Top 75 Posts
Joined on 04-29-2010
Posts 10
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Yeah, we have a single editor that may be pointed to separate web servers so the base reference url will be different between them even though the image filename will be the same.
   Report 
   08-18-2011, 1:24
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Hi Mordy,

Here is the answer.
Before you set any text to editor.text use this command to set the relative paths:

editor.execute("globalImagePathRelative='http://')")

This will create a new image without referencing the url.

Hope this helps.
   Report 
   08-18-2011, 1:28
sfi_dev is not online. Last active: 06.02.2012 20:24:28 sfi_dev

Top 25 Posts
Joined on 05-12-2011
Posts 25
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
Oops sorry Mordy, I keep forgetting I cannot include tags in emails because the text gets stripped out. Try again

Before you set any text to editor.text use this command to set the relative paths (changing myurl/images to your base URL):

editor.execute("globalImagePathRelative='http://myurl/images/')")

Then to insert any new images use the following command (changing newimagename to your image e.g. logo.gif
editor.Execute ("editRelativeCreateImage('newimagename')")


   Report 
   10-03-2011, 2:59
Mordy is not online. Last active: 09.08.2011 11:53:25 Mordy

Top 75 Posts
Joined on 04-29-2010
Posts 10
Re: ActiveX - Set BaseReferenceImage , html generated still inserts the full url
Reply Quote
OOh...thanks Sci_dev, I didn't see you post this but I still have the problem - I'll give it a try!
   Report 
Pintexx Forum » Developer Produ... » pinEdit » ActiveX - Set BaseReferenceImage , html generated still inserts the full url