Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-06-17 07:43:43

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

custom field as an url

my template:

<table class="kalender"><txp:article form="kalender" limit="200" /></table>

form “kalender”:

<tr><td><txp:posted format="%d.%m.%Y" /></td>
<td><a href="<txp:custom_field name="url" />"><txp:title /></a></td><td><txp:custom_field name="asukoht" /></td><td><txp:custom_field name="distants" /></td><td><txp:custom_field name="korraldaja" /></td></tr>

is it correct code?

anyway, it works until i insert some webpage full url (http://www…) into custom field named ‘url’. then i get error: sorry, the form could not be submitted!

the html output of that form:

<table class="kalender"><tr><td>10.08.2012</td>
<td><a href="">Raplarull</a></td><td>Rapla, EST</td><td>20km, 42km</td><td>EMT</td>
</tr>
</table>

?

Offline

#2 2013-06-17 07:54:13

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: custom field as an url

Gallex wrote:

sorry, the form could not be submitted!

related?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2013-06-17 09:58:32

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: custom field as an url

Gallex wrote:

is it correct code?

Default setting of custom fields is to escape html. You should change the setting by adding escape="" in your form.

<txp:custom_field name="url" escape="" />

You should also check if the custom field is not empty. If so you end up with an empty <a href="">
This will be something like:

<txp:if_custom_field name="url"><a href="<txp:custom_field name="url" escape="" />"><txp:title /></a><txp:else /><txp:title /></txp:if_custom_field>

This may be not related to the popup error you see, but you never know…

Last edited by kees-b (2013-06-17 10:01:57)

Offline

#4 2013-06-17 13:11:06

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: custom field as an url

kees-b wrote:

This may be not related to the popup error you see, but you never know…

…still, ‘sorry, the form could not be submitted!’ :(

Offline

#5 2013-06-17 13:31:13

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: custom field as an url

Do you use a plugin that works on custom fields?
Did you check your error.log (or equivalent)?

Offline

#6 2013-06-17 13:35:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: custom field as an url

Also do you use the mlp plugin?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2013-06-17 15:49:43

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: custom field as an url

I got the same problem than Gallex. My custom_field name called “web” works pefectly with values like “www.foo.com”, “ttp://www.foo.com” but not with “http://www.foo.com. I have tried all combinations of” and “/” and it works great but with “http://”, so in apperance the text “http://” blocks the article saving (perhaps a security issue of a plugin?)


<txp:rocks/>

Offline

#8 2013-06-17 19:08:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: custom field as an url

milosevic wrote:

I got the same problem than Gallex. My custom_field name called “web” works pefectly with values like “www.foo.com”, “ttp://www.foo.com” but not with “http://www.foo.com. I have tried all combinations of” and “/” and it works great but with “http://”, so in apperance the text “http://” blocks the article saving (perhaps a security issue of a plugin?)

If that is the case you could try

<txp:if_custom_field name="url">
<a href="http://<txp:custom_field name="url" escape="" />"><txp:title /></a><txp:else /><txp:title /></txp:if_custom_field>

In this way all you will need to add is the rest of the url.

I use a custom field in a very similar way without any problems. I’m wondering if milosevic’s theory is right for Alesh. I would disable all plugins and see if the field can be saved.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2013-06-18 10:04:21

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: custom field as an url

Do you use a plugin that works on custom fields? Also do you use the mlp plugin?

no

Did you check your error.log (or equivalent)?

no

<txp:if_custom_field name=“url”>
<a href=“http://<txp:custom_field name=“url” escape=”“ />”><txp:title /></a><txp:else /><txp:title /></txp:if_custom_field>
In this way all you will need to add is the rest of the url.

this way it’s really working, great! thank’s colak!

I use a custom field in a very similar way without any problems. I’m wondering if milosevic’s theory is right for Alesh. I would disable all plugins and see if the field can be saved.

disabled, couldn’t to save

Offline

#10 2013-06-18 13:09:08

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: custom field as an url

Check with your hosting provider. Seems like your standard packet filtering issue.

Offline

#11 2013-06-18 13:19:44

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: custom field as an url

Gallex, can you capture the network traffic with Firebug or something similar when you click “Save” and receive the notorius “Sorry, the form could not be submitted. Please try again later.” message?

I am interested in your server’s response. It usually looks something like this:

;
	$(document).ready(function() {
		$("#messagepane").html("<span id=\"message\" class=\"success\">.

Offline

#12 2013-06-18 13:19:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: custom field as an url

You might want to check jukka’s reply here


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB