Welcome, Guest
Username Password: Remember me

** NEW PLUGIN: SD Field Concat V.2.2.6 - SEBLOD 2.3.x - Concatenate fields, text & predefined variables, multiple checkboxes & more
(1 viewing) (1) Guest

TOPIC: ** NEW PLUGIN: SD Field Concat V.2.2.6 - SEBLOD 2.3.x - Concatenate fields, text & predefined variables, multiple checkboxes & more

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #31

Greetings Everyone,
I needed to plug addresses into something called a "Walk Score" in a custom template for my real-estate site.

I used Simon's Concat plugin to pull together three separate address fields into one field. It works like a charm!

In case others are trying to accomplish something similar, I thought I'd document what I did.

1. Created three text fields, and added them to the Content view of my content type. They have the following names:
address
city
state

2. Created a field named "address_concat" in the Content view of my content type.

3. Entered this in the "List of Fields" area of the "address_concat" field:
#address#,#city#,#state#

4. Entered a comma as the "Value Separator" of the "address_concat" field.

5. In my custom template, there is a block of code that references the API for the Walk Score. The line that needs attention is the one that calls the address.

By default, the line of code looks like this:
var ws_address = 'insert address here';


I edited the line of code to look like this:
var ws_address = '<?php echo $cck->me->address_concat->value; ?>';


Obviously, step 5 is specific to the Walk Score API I'm using, but I assume the concat syntax would be similar for other situations.

The variable picks up the address and plugs it into the Walk Score very nicely!

Excellent work Simon!

Thanks,
Matthew

PS: For anyone else doing a real-estate site, the Walk Score is an excellent resource. Check it out here: www.walkscore.com
Last Edit: 1 year, 7 months ago by MatthewSchenker.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #32

@MatthewSchenker,

Glad to see this plugin is of use to you

Regards,
Simon
My SEBLOD Extensions on the JED

SD Field Concat

Was I helpful and did I save you hours of work or research? Consider donating something small as I volunteer my time to the community.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #33

  • Jiliko
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 98
Hi,

Just a question, i think i know the answer : Does the plugin concat value live ? I mean, is the concatenation stored in a field or does it take each required value live and concat them for display purpose ?

I ask this cause i need a concat field for search purpose... I need a simple text field that would search in many fields of a content type...

Thx,

Olivier

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #34

@Jiliko,

Not sure I quite understand the question, apologies, however what this field really does it concatenates values BEFORE FORM SAVE into one value and stores that value wherever you specified.

So essentially it is no different to a text field, it's values are just grabbed from other form fields. The updated field will the following:

  • Ability to set date format
  • Ability to RENDER the concatenated field on content views
  • Ability to set JText on your concatenated hard coded text so that differnet languages have different predefined strings. This means that for 6 languages you need one concat field, not 6. Language strings are added to you language override files in admin.


Did I answer your question? I hope so!

Kind regards,
Simon
My SEBLOD Extensions on the JED

SD Field Concat

Was I helpful and did I save you hours of work or research? Consider donating something small as I volunteer my time to the community.
Last Edit: 1 year, 7 months ago by SimonDowdles.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #35

  • Jiliko
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 98
Thx Simon for your answer,

So, great, the concat values are stored in db, that's what i wanted to know...

Can it be searchable ? I mean can i create some custom code in a template position with a text field which name would be the concat field name and search for it ?

Thx,

Olivier

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #36

@Jiliko,

Good question! Never tried to search it but I'd imagine it would work. Add a test field, include it in your search and give it a bash! Be sure to let me know

Regards,
Simon
My SEBLOD Extensions on the JED

SD Field Concat

Was I helpful and did I save you hours of work or research? Consider donating something small as I volunteer my time to the community.
Last Edit: 1 year, 7 months ago by SimonDowdles.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #37

  • Jiliko
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 98
Hi Simon,

Good news, it works !!!

But i had to add the 'onCCK_FieldPrepareSearch' function declaration in your plugin code to make it searchable.

I've just copied the function form the 'text' field plugin and it works like a charm.

This involves single field search on many fields can be implemented in SEBLOD !

So, to detail what i've done :

- I've installed your plugin
- I've updated the 'plugins/cck_field/sd_field_concat.php' file by adding this code before the last '}' :

 
// onCCK_FieldPrepareSearch
public function onCCK_FieldPrepareSearch( &$field, $value = '', &$config = array(), $inherit = array(), $return = false )
{
if ( self::$type != $field->type ) {
return;
}
 
// Prepare
self::onCCK_FieldPrepareForm( $field, $value, $config, $inherit, $return );
 
// Return
if ( $return === true ) {
return $field;
}
}
 


- I've created a new concat field for a content type (the field is stored in the specific content type table : #__cck_type_{content_type}), set the list of fields i need to concat and set a separator value to '|'.

- I've set this field in admin/stie form (displayed as hidden by default) and in my search type form in the 'topbody' position. It's the only field in this position to ease the position override.

- I've created the 'topbody' position override file and set this code in it :

 
<?php
/**
* @copyright Copyright (C) 2011 Seblod. All Rights Reserved.
**/

 
// No Direct Access
defined( '_JEXEC' ) or die;
?>
 
<div id="cck1r_pc_fulltext_search" class="cck_forms cck_search cck_text cck_pc_fulltext_search">
<div id="cck1r_label_pc_fulltext_search" class="cck_label cck_label_text">
<label for="pc_fulltext_search">Code produit</label>
</div>
<div id="cck1r_form_pc_fulltext_search" class="cck_form cck_form_text">
<input type="text" id="pc_fulltext_search" name="pc_fulltext_search" value="" class="inputbox text " maxlength="50" size="32">
</div>
</div>
 


Replace 'pc_fulltext_search' with the name of your concat field and 'Code produit' with the label you want or cck code to display the one you've set in backend...

And now i have a simple text field where i can search for any field values set in the concat field. You can set the 'match' value for the field in the search to what's better for you.

I hope it'll help other people...

Thanks again Simon for the plugin, it's a good base for me to start developing mine.

Olivier
Last Edit: 1 year, 7 months ago by Jiliko.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #38

Many thanks,

I am aware of this yes. This is updated in newer version (with more features) and will release soon. Initially the plugin was released just to create unique titles, but it's grown into much more than that now!

Kind regards,
Simon
My SEBLOD Extensions on the JED

SD Field Concat

Was I helpful and did I save you hours of work or research? Consider donating something small as I volunteer my time to the community.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #39

  • Jiliko
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 98
Simon,

Great to know this field is going to be even ore powerful.

One more question : My field list exceeds 255 characters which is the max set for the input field. I can't find where/how this value can be overrided. I've seen a $config array in the 'plugins/cck_field/sd_field_concat/tmpl/edit.php' file but don't know if i can do something with this. I've tried :

$config['maxlength'] = '500';


But it's not that...

Olivier

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #40

@jiliko,

In SEBLOD admin area go to fields -> list fields to show ALL seblod fields. On the right is a drop down list set to 'On', change that to 'All' which will load fields used by the plugins too.

Search for the field 'sd_core_field_concat_list' and change the maxlength from 255 to anything, maybe 1000. Save it, do not change any of the development storage options.

Kind regards,
Simon
My SEBLOD Extensions on the JED

SD Field Concat

Was I helpful and did I save you hours of work or research? Consider donating something small as I volunteer my time to the community.
Last Edit: 1 year, 7 months ago by SimonDowdles.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #41

  • Jiliko
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 98
Simon,

You save my day again !

This opens new doors for me ! I just realize this means you can create fields with "options" based on other fields ??? is the type of field limited to text, select ?

Olivier

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #42

What this field does (at the moment) is create a single value to be saved into a single location (whatever storage you choose in field options) but it's value is made up of multiple fields in your form, plain text values and dates / user id's / user name.

Kind regards,
Simon
My SEBLOD Extensions on the JED

SD Field Concat

Was I helpful and did I save you hours of work or research? Consider donating something small as I volunteer my time to the community.

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #43

  • Jiliko
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 98
Simon,

Sorry, i was talking about the fact that the field list option in your CCK field plugin is based on a CCK field plugin too.

for me, this could involve you could create a CCK field select list based on a sql query that retrieves data from a db table and use this CCK field as an select list option for another CCK field.

I don't know if i'm clear.

Olivier

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 7 months ago #44

  • dan1dyoung
  • ( Moderator )
  • OFFLINE
  • Administrator
  • Posts: 978
Hi Jiliko,

Yes the fields in a plugin can use "Dev" fields in the standard Field Manager, it is not just text fields (See my Facebook one for example which uses text/simple_select) you can see if you open a core field such as image_upload the file size drop-down is a dev field, the options are dev fields with a FieldX.

This is what makes it even cooler, the fields can be created in the UI or with a simple XML file and any Dev fields used in your plugin are exported with it when you export the plugin in the plugin manager screen

Thanks

Dan
If you use jSeblod CCK, please post a rating and a review at the Joomla! Extensions Directory. For any of my jSeblod CCK Packs or tips visit my site D.Y.Solutions

To keep up to date with new videos about Seblod 2.0 subscribe or visit our channel here

Re: NEW FIELD - SD Field Concat - Concatenate fields, text & predefined variables... 1 year, 6 months ago #45

  • damendieta
  • ( User )
  • OFFLINE
  • Gold Boarder
  • Posts: 202
Hi, I tried SD Field Concat on a clean GA install and it's not working.

Somebody else has this problem too or it's just my instalation.

Thanks a lot.


Daniel.
Last Edit: 1 year, 6 months ago by damendieta.
Time to create page: 0.56 seconds