203 Posts
louispapera
9 years ago
Topic
Dear Sebloders, currently I use sd field concat and I have realized a field where I have an internet address.
It is ok as link but: now, I would like to transer this field in a new fielf called "link" because,  do not like me to have as link a long field (ie: http://domain_name/web_page//item/etc.........) . Is there a way for do this one.
Sincerely I created a field, his name is "link" but I do not know as do to transfer the field address that contain URL.
Many thanks in advance, Best regards, Louis
Get a VIP membership
4229 Posts
Kadministrator
9 years ago
1
Level 1
Hi,

one solution would be to add conditional state (Is filled by) in your new link field and resave all items
203 Posts
louispapera
9 years ago
0
Level 2
Dear Klas, many thanks for suggestions. I try but when I work records with admin site, in head to the page I received the following error:

" }); (function ($){ $(document).ready(function(){$("#cck1r_link").conditionalStates({"states":[{"type":"isFilledBy","selector":"","revert":"1","value":"url"}],"conditions":[{"type":"isEqual","trigger":"category_anagrafica_enti","value":"10"}],"rule":"and"});});})(jQuery); window.addEvent('domready', function() { SqueezeBox.initialize({}); SqueezeBox.assign($$('a.modal_jform_contenthistory'), { parse: 'rel' }); }); "

Have you any idea about this error or a new suggestions to resolve problem.

Thank you again, regards, Louis

4229 Posts
Kadministrator
9 years ago
3
Level 1
Hi,

not sure about this error, but it work ok for me if I set conditional to "isFilledBy" and enter source field id in first window, then un-check Revert and select source field as trigger with "is Filled". I tested it with article title (as source) and article alias (as target where value gets copied).
203 Posts
louispapera
9 years ago
2
Level 2
Dear Klas, many thanks for your reply, I try again but I always have an error. It does not work yet.
See from youself this PDF file for your better knowledge, perhaps I did a mistake still. 

http://regionesiciliana.altervista.org/link.pdf

In await for your reply.
Best Regards, Louis
4229 Posts
Kadministrator
9 years ago
1
Level 3
Hi,

on the right side you should select the same field as on the left. Also check if you have entered the right id on the elft side(url), id is the same as field name (e.g. article title field has id art_title)
203 Posts
louispapera
9 years ago
0
Level 4
Dear Klas, thanks again for your support, I entered the same field (url) also on the right side, as for your suggestions. 
I tried but do not work. I verified id field and it is "url".
I hope you find a solution. Meantime, I send you a new description file again.

http://regionesiciliana.altervista.org/link2.pdf

Best regards, Louis
4229 Posts
Kadministrator
9 years ago
5
Level 1
looks right to me, same setup works for me to copy article title to article alias field. Perhaps one thing - you need to actually click on source (url) field, pehaps try chaging it if it trgiggers then. Do you still get errors? The one that you psoted above is missing actuall error and its description.
203 Posts
louispapera
9 years ago
4
Level 2
Dear Klas, following the error description:

"}); (function ($){ $(document).ready(function(){$("#cck1r_link").conditionalStates({"states":[{"type":"isFilledBy","selector":" #link","revert":"0","value":"url"}],"conditions":[{"type":"isFilled","trigger":"url","value":""}],"rule":"and"});});})(jQuery); window.addEvent('domready', function() { SqueezeBox.initialize({}); SqueezeBox.assign($$('a.modal_jform_contenthistory'), { parse: 'rel' }); });"

If I delete url field by triggers, option go in error. That is all fields are resetted.
Mistery, I think with a litte (more) patiente we go to solve problem.
Best regards, Louis 
4229 Posts
Kadministrator
9 years ago
3
Level 3
HI,

each error has a description like "Wrong type" or "xy is not defined"  - what you posted shows a bunch of code, not error itself.

e.g. with firebug extension for firefox you can see error in the red line https://getfirebug.com/errors
203 Posts
louispapera
9 years ago
2
Level 4
Dear Klas, I send you a new link as for your suggestions: http://regionesiciliana.altervista.org/link3.pdf
This is the error that I receive . I hope that this informations obtained through firebugs is useful for you. 
Meantime, I receive your news, best regards, Louis
4229 Posts
Kadministrator
9 years ago
1
Level 5
Hi,

what is causing the error in your case is this part:

<script type="text/javascript">
<!--function doRedirect() {
//funzione con il link alla pagina che si desidera raggiungere location.href = "http://www.regione.sicilia.it/famiglia/";
}
window.setTimeout("doRedirect()", 4000); //Fa partire il redirect dopo tot. secondi //-->
</script>

Thiss is not coming from conditional, it looks like you entered this text in js field of "stuff" window that appears in field configuration after you press orange arrow - you need to remove starting and ending script html tags, in that window you just insert raw javascript, the rest is done by seblod
203 Posts
louispapera
9 years ago
0
Level 6
Dear Klas, I have forgotten about a wrong script that I had insert within the field "link". Excuse me for the mistake.
I have deleted it and I have tried following previous posts. I did many tests. Nothing. It does not work.
If you have any different ideas to reach the purpose, please, inform me.
Now, I am just in await for reply to Randy for trying his suggestion.
I hope that at least one of you help me to resolve this problem, also for the time that you have dedicate to me.

Many thanks, awaiting, Louis 
693 Posts
rpoy
9 years ago
5
Level 1
Hi,

Possibly a second method, might be to create a second SD Concat field with the same settings, but instead define the storage as your second link.  Would that work?

Randy
203 Posts
louispapera
9 years ago
4
Level 2
Dear Randy I have not clear your reply. I have to create a new concat field with the same setting, so all right, then I do not understand your suggestion about the field storage.
Could I have more informations about this latest suggestion, please ?  Many thanks , louis

p.s. I would like to have a link rather that a long web address: http://regionesiciliana.altervista.org/index.php/lista-anagrafica-enti?ente_cfpi=&ente_provincia=&ente_comune=&denominazione_ente=&cck=anagrafica_enti&boxchecked=0&search=lista_anagrafica_enti&task=search&start=25
693 Posts
rpoy
9 years ago
3
Level 3
Hi Louis,

Normally I think what Klas suggested should work. But the isFilled routine may not like the slash characters or length in your URL.
So perhaps using the SD Conat field, may work for you...

In your example, your URL field can use the same storage as the Link field. The format for the storage of a Link field must be in the following format:
{"link":"www.myurl.com","text":"mylinktitle"}


So you can use the SD concat field to create the following format it like so:
[{"link":"]||#mylink#||[","text":"]||#mylinktitle#||["}]

where
#mylink# = all of your fields you are currently concatenating
#mylinktitle# = the title you want to use - or how you wan it to display.

The storage of this SD Concat should be set to your Link field.

You will need to set the Value Separator to ns - which you are already doing.

In my test, the one issue that I noticed:
In the Admin/Site sections, if you have both a link field and an SD concat field, you have to save it twice. But you dont need the Link field in the Admin/Site section because you are using the SD concat field to build it. You should be able to use the Link field in the Search or Content like you would normally.

Hope that helps,

Randy
203 Posts
louispapera
9 years ago
2
Level 4
Dear Randy, many thanks, now it is all right, your suggestions have been well done.
Now, only one thing: I would like to have in output only the voice link and not {"link":"","text":""} . How I do ?
See you again web site, please.
Many thanks also to Klas for his help.  Best regards, Louis
142 Posts
pretobrazza
9 years ago
1
Level 5
Hello Louis,

Maybe I mis-read your question but I only show the word [LINK] in my list (of course I could replace this by a 'pdf-icon' to make it prettier :) )

This is the way I did it in my case on the field:  List&Searchtype -> List-> #2 Typography set to HTML -> press '+' and put html code in the style of: 
<a href="/images/publicaties/$cck->getvalue('pdfname')" target="_blank">[OPEN PDF]</a>
or in your case maybe ...
<a href="/$cck->getvalue('YOURpdflinkFieldname')" target="_blank">[OPEN PDF]</a>

Like HERE I get a link without any http etc ..

Kind regards,
Bernard
203 Posts
louispapera
9 years ago
0
Level 6
Hellò Pretobrazza, thank you for your reply. I resolved directly problem.
Many thanks again. Best regards for all. Louis
Get a Book for SEBLOD