? ?
avatar pieter-groeneweg
pieter-groeneweg
28 May 2020

I noticed that in the config for Contacts List Layout there are options for any field in a contact but for the Street Address.

This is in my current J!3.9 but it also appears to be in J!4

avatar pieter-groeneweg pieter-groeneweg - open - 28 May 2020
avatar joomla-cms-bot joomla-cms-bot - change - 28 May 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 May 2020
avatar pieter-groeneweg
pieter-groeneweg - comment - 28 May 2020

i checked within a j!3.9

the following changes will solve. My experience in github, cloning, submitting and on is too little to do it in another way. Sorry for that.

Following is to be inserted

			<field
				name="show_street_address_headings"
				type="list"
				label="COM_CONTACT_FIELD_CONFIG_STREET_ADDRESS_LABEL"
				description="COM_CONTACT_FIELD_CONFIG_STREET_ADDRESS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>	

into following files at approx line number

254 \components\com_contact\views\category\tmpl\default.xml
302 \components\com_contact\views\categories\tmpl\default.xml
106 \components\com_contact\views\featured\tmpl\default.xml

			<field
				name="show_street_address_headings"
				type="radio"
				label="COM_CONTACT_FIELD_CONFIG_STREET_ADDRESS_LABEL"
				description="COM_CONTACT_FIELD_CONFIG_STREET_ADDRESS_DESC"
				default="0"
				class="btn-group btn-group-yesno"
				showon="show_headings:1"
				>
				<option value="1">JSHOW</option>
				<option value="0">JHIDE</option>
			</field>

into following file at approx line number

835 \administrator\components\com_contact\config.xml

This needs to be added to the database files in the insert of the extensions table

"show_street_address_headings":"1"

Somewhere.. forgivem as I am not too familiar with DB ins and outs

In the language file /public_html/administrator/language/en-GB/en-GB.com_contact.ini following constants need an entry:

COM_CONTACT_FIELD_CONFIG_STREET_ADDRESS_LABEL="Street Address"
COM_CONTACT_FIELD_CONFIG_STREET_ADDRESS_DESC="Show or hide a Street Address column in the list of Contacts."

This now allows the Street Address to be show or hidden in de contact category lists layout

$item->address

already is available to be used in templates

ie. in "core" /components/com_contact/views/category/tmpl/default_items.php insert at line 96

<?php if ($this->params->get('show_street_address_headings') && !empty($item->address)) : ?>
	<?php $location[] = $item->address; ?>
<?php endif; ?>

This tiny bit resolves the issue. Tested on a 3.9.18 and it works.
Surprising it was never there but it would be awesome if it could be added to current 3.9 and future 3.10 and 4.x

avatar pieter-groeneweg
pieter-groeneweg - comment - 29 May 2020

Just found out.. same applies to postcode / zip code field in contact list view

avatar AndyGaskell
AndyGaskell - comment - 30 May 2020

I was just looking in the new joomla 4 beta 1 and it seems ok.

Please let me know if I've misunderstood the issue, apologies if so.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29246.

avatar AndyGaskell
AndyGaskell - comment - 30 May 2020
avatar pieter-groeneweg
pieter-groeneweg - comment - 2 Jun 2020

I just checked 4.0 Beta. It is not in tab "list layout".
image

avatar AndyGaskell
AndyGaskell - comment - 2 Jun 2020

Hi @pieter-groeneweg sorry, I missed that it was in the list view, rather than the item view.

avatar SharkyKZ SharkyKZ - change - 3 Jun 2020
Labels Added: ?
avatar SharkyKZ SharkyKZ - labeled - 3 Jun 2020
avatar rdeutz rdeutz - change - 18 Dec 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-12-18 10:36:14
Closed_By rdeutz
avatar rdeutz rdeutz - close - 18 Dec 2020

Add a Comment

Login with GitHub to post a comment