target="blank" is dissapearin from source-code

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
User avatar
eccentric.worx
Posts: 71
Joined: Mon 31. Oct 2005, 00:22
Location: berlin

target="blank" is dissapearin from source-code

Post by eccentric.worx »

Just realised that any linktarget i put into contentparts/templates etc. is somehow disappearing from the generated source-code.
checked the code twice, target="blank" is definetely used in several contentparts and templates inside the backend.
even an update did´nt solve this problem, so i checked the database: target is there...
removed all scripts and addtional stuff from the templates, just in case a JS is removing all targets... no result, all targets are not showing up in the generated source-code even if they exist in the CP´s.

Does anyone have any idea how to solve this problem?

Thanks in advance!

äh,
started with version v1.47_r412 or 1.47_r415 (not shure anymore...) - updated to 1.5.4_r488 one month ago without change.
hoster: hosteurope
PHP 5.2
register_globals Off
safe_mode Off

Dirk
nameless1
Posts: 878
Joined: Sun 27. Apr 2008, 23:22

Re: target="blank" is dissapearin from source-code

Post by nameless1 »

hallo,

do you check the souce code in wysiwyg-editor?

nml1
Haasboy
Posts: 12
Joined: Mon 28. May 2012, 09:34

Re: target="blank" is dissapearin from source-code

Post by Haasboy »

Change your doctype config value you've set, I had the same problem... I figured the problem after doing a bit of reasearch on the doctype element.
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: target="blank" is dissapearin from source-code

Post by Oliver Georgi »

target in combination with HTML5 is something you shouldn't use. Use a JavaScript that imitates the same behavior on click. I use a special class that triggers an onclick event.

Here is the jQuery I use for this:

Code: Select all

$(function(){
	$('a.blank,a[href^="http:"]').not('[target]').each(function(){
		$(this).prop({
			'target':'_blank'
			// if you want to use the linktext as title text remove the comment
			//,'title':$(this).text()
		}).addClass('blank');
	});
});
It matches for <a class="blank" /> or <a href="http:…" /> having no attribute target.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
eccentric.worx
Posts: 71
Joined: Mon 31. Oct 2005, 00:22
Location: berlin

Re: target="blank" is dissapearin from source-code

Post by eccentric.worx »

Many thanks! Regarding to your suggestions i could identify the problem and solve it by changing the document type from xhtml strict to xhtml transitional. :D
Post Reply