clowride VIP
Total posts: 1,022
15 Sep 2013 06:55

hello

with text search field in module filter, i 'am trying to add INSIDE the field "looking for something" any idea how can i do that please

thank you very much

Last Modified: 02 Mar 2014


pepperstreet VIP
Total posts: 3,837
16 Sep 2013 17:25

Go to:

/cobalt/modules/mod_cobalt_filters/tmpl

You should make a copy of:

default.php

Rename it to something like:

default-placeholder.php

Open in your favorite text/code editor.

Look around line# 41.

There you will find the general search input field with name="filter_search".

Simply add "placeholder" attribute, like it is used in markup-template, too.

Original line:

<input type="text" class="span12" name="filter_search" value="<?php echo $state->get('records.search');?>" />

Replace with:

<input type="text" placeholder="<?php echo JText::_('CSEARCHPLACEHOLDER');?>" class="span12" name="filter_search" value="<?php echo $state->get('records.search');?>" />

Frontend result:

Heads-up:

CSEARCHPLACEHOLDER is the sample language constant from markup-template. You might use your own constant e.g. :

CSEARCHPLACEHOLDERMODULE

Then you can use Joomla language override manager to create independent terms and translations.


pepperstreet VIP
Total posts: 3,837
16 Sep 2013 17:26

@Sergey / MintJoomla

I suggest to add this attribute and respective language constants in future releases. Thanks in advance.


clowride VIP
Total posts: 1,022
17 Sep 2013 00:47

Go to:

/cobalt/modules/mod_cobalt_filters/tmpl

You should make a copy of:

default.php

Rename it to something like:

default-placeholder.php

Open in your favorite text/code editor.

Look around line# 41.

There you will find the general search input field with name="filter_search".

Simply add "placeholder" attribute, like it is used in markup-template, too.

Original line:

< input type="text" class="span12" name="filter_search" value="get('records.search');?>" />

Replace with:

< input type="text" placeholder="" class="span12" name="filter_search" value="get('records.search');?>" />

Frontend result:

Heads-up:

CSEARCHPLACEHOLDER is the sample language constant from markup-template. You might use your own constant e.g. :

CSEARCHPLACEHOLDERMODULE

Then you can use Joomla language override manager to create independent terms and translations.

Reply

By pepperstreet Today

Do not forget to select your copy in module parameters! Tab -> Options -> Alternative Layout parameter

Thank you very much :)

Powered by Cobalt