Jump to content

IP Pages with Supergrid help needed


Gauravk

Recommended Posts

I'm using IP pages for the car business listing section for two years, developed by some other programmer. Recently installed supergrid and loved its entire look and feel but first two header row shifting images to right instead of center.

I tried editing the record image field in display option coding to center images, but it didn't work.

Appreciate if anyone can please help on this regard, as what I am missing or what code went wrong in the past.......?

Thanks in advance

https://carnity.com/business_listing/

image.thumb.png.d18eeeed5a79044729b91b13601991a5.png

 

Image field - display code

<br><div class="ipsClearfix">
{{foreach $value as $image}}
  <img style="height: 160px; width: 240px;" align="center" src='{file="$image" extension="cms_Records"}'>
{{break;}}{{endforeach}}
</div>

 

Link to comment
Share on other sites

Your issue starts before the image field display - there is ipsPos_right before the code pasted by you:

image.png.19f62621de97e15147515f755b23e9ed.png

I am far from CSS expert, but I think this is where part of your issue is. Resizing the window also brings some strange things, for exampe the avatar goes to the left of the picture:

image.png.db040aa658205bf4115c208a0d2d86d3.png

 

For the bottom row, the image floats to the left of the block:

image.thumb.png.ec90ea48c9df3b7925a62f2d973bf6b3.png

 

As this also happens with the default theme, it is pretty much caused by the modifications you or your developer made. I would reupload the SG templates with the latest version and start from scratch. 

Link to comment
Share on other sites

29 minutes ago, opentype said:

No. Customizations are not part of support. 😉 

Didn't know he asked about customizations

Quote

Recently installed supergrid and loved its entire look and feel but first two header row shifting images to right instead of center.

Going by that sentence I assumed that was from a fresh install

Link to comment
Share on other sites

30 minutes ago, opentype said:

No. Customizations are not part of support. 😉 

Well, it was a case of the previous customization and not the current one, as I'm fairly happy with Supergrid option.

Appreciate if you can help in bringing this to stock version or advising how little tweak to center the image is possible, please.

Link to comment
Share on other sites

Try to use a background image url 😉

Before, reminder to copy your actual code in a note if this don't work.

Delete it :

<div class="ipsPos_right">
<br><div class="ipsClearfix">
<img style="height: 160px; width: 240px;" align="left" src="https://carnity.com/uploads/monthly_2018_10/IMAG0019.jpg.572084a1d562f86c87afdb197af1499a.jpg">
</div>
</div>

 search this line :

<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: 50%;
">

Add background-image url in the style :

background-image:url('{file='$image' extension='cms_Records'}')

Result :

<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: 50%; background-image:url('{file='$image' extension='cms_Records'}')
">

 

I try it in your site with dev tool safari, and that will be something look that  (I modified your article "silver star tyres & wheels LLC"):

1545726937_Capturedcran2018-10-0116_36_18.thumb.png.c0217989c2aa85802c278dcbf7400905.png

Link to comment
Share on other sites

Thanks a lot, @scaz for making an attempt to help, really appreciate it.

One thing I like to highlight is if I remove the listing code from image field then it will display all images as there are up to 8-10 images in that field.

Secondly, before adding the bg image, I think you take a look at an actual SG frontpage entry file, as I feel it is already using something like BG what you are intending.

If we can't fix this first-row image to be centered issue then I will be fine with an option to delete the whole first row and keep a layout of 3 tiles instead of 2 on top and 3 tiles in the bottom.

 

{{if settings.SuperGrid_image_add_link}}
<a href="{$record->url()}" title="{lang="read_more_about" sprintf="$record->_title"}">
{{endif}}
<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: {{if settings.SuperGrid_aspect_ratio}}{setting='SuperGrid_aspect_ratio'}%{{else}}50%{{endif}};
{{if $record->record_image}}background-image:url('{{if settings.SuperGrid_image_use_thumbnail}}{file='$record->_record_image_thumb' extension='cms_Records'}{{else}}{file='$record->record_image' extension='cms_Records'}{{endif}}');{{elseif settings.SuperGrid_fallback_image}}background-image:url('{setting="SuperGrid_fallback_image_url"}');{{endif}}">

  
<div class="ipsPos_left">
{{if ($record->mapped('featured') AND settings.SuperGrid_show_feature_badge)}}
  		<span class='ipsBadge ipsBadge_style{{if settings.SuperGrid_feature_badge}}{setting="SuperGrid_feature_badge"}{{else}}7{{endif}}'>{lang="featured"}</span>
{{endif}}
{{if ($record->mapped('pinned') AND settings.SuperGrid_show_pin_badge)}}
  		<span class='ipsBadge ipsBadge_style{{if settings.SuperGrid_pin_badge}}{setting="SuperGrid_pin_badge"}{{else}}6{{endif}}'>{lang="pinned"}</span>
{{endif}}
</div>
 
{{if settings.SuperGrid_listing_fields_position==1}}  
<div class="ipsPos_right">
{{if count( $record->customFieldsForDisplay('listing') )}}
		{{foreach $record->customFieldsForDisplay('listing') as $fieldId => $fieldValue}}
			{{if $fieldValue}}
				{$fieldValue|raw}
			{{endif}}
		{{endforeach}}
{{endif}}
</div>
{{endif}}
  
</div>
{{if settings.SuperGrid_image_add_link}}</a>{{endif}}
  
{{if settings.SuperGrid_avatar}}
	<div class="SG_avatar_wrapper {{if settings.SuperGrid_avatar_alignment}}{setting='SuperGrid_avatar_alignment'}{{else}}ipsType_center{{endif}}">
	{template="userPhoto" app="core" params="$record->author()" group="global"}
	</div>
{{endif}}


<div class="{{if settings.SuperGrid_title_alignment}}{setting='SuperGrid_title_alignment'}{{else}}ipsType_center{{endif}}">
<h2 class='ipsSpacer_both'>
				{{if $record->prefix()}}
					{template="prefix" group="global" app="core" params="$record->prefix( TRUE ), $record->prefix()"}
				{{endif}}
				{{if $record->isFutureDate() || $record->mapped('pinned') || $record->mapped('featured') || $record->hidden() === -1 || $record->hidden() === 1}}
					{{if $record->isFutureDate()}}
					<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span>
					{{elseif $record->hidden() === -1}}
					<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$record->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
					{{elseif $record->hidden() === 1}}
					<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
					{{endif}}
				{{endif}}
			
				<div class='ipsType_break'>
					<a href="{$record->url()}" title="{lang="read_more_about" sprintf="$record->_title"}">
						{$record->_title}
					</a>
				</div>
</h2>
  

{{if settings.SuperGrid_byline}}
		<p class="ipsType_light ipsType_reset {{if settings.SuperGrid_meta_alignment}}{setting='SuperGrid_meta_alignment'}{{else}}ipsType_center{{endif}}">
			{lang="cms_byline" htmlsprintf="$record->author()->link(), $record->container()->url(), $record->container()->_title"}<span class="SG_hold_together">{datetime="$record->record_publish_date"}</span>
		</p>
{{endif}}
  
  
{{if settings.SuperGrid_listing_fields_position==2}}  
<div class="{{if settings.SuperGrid_meta_alignment}}{setting='SuperGrid_meta_alignment'}{{else}}ipsType_center{{endif}}">
{{if count( $record->customFieldsForDisplay('listing') )}}
		{{foreach $record->customFieldsForDisplay('listing') as $fieldId => $fieldValue}}
			{{if $fieldValue}}
				{$fieldValue|raw}
			{{endif}}
		{{endforeach}}
{{endif}}
</div>
{{endif}}          

{{if settings.SuperGrid_activity}}				
<div class="ipsType_light {{if settings.SuperGrid_meta_alignment}}{setting='SuperGrid_meta_alignment'}{{else}}ipsType_center{{endif}}">	
{{if $record::database()->options['comments']}}
	<span class="SG_byline SG_byline_first SG_hold_together">{lang="num_comments" pluralize="$record->record_comments"}</span>
{{endif}}
                 
{{if $record::database()->options['reviews'] AND $record->averageReviewRating()>0}}
	<span class="SG_byline">
	{template="rating" app="core" params="'small', $record->averageReviewRating(), \IPS\Settings::i()->reviews_rating_out_of, $record->memberReviewRating()" group="global"}
	</span>
{{elseif $record->container()->allow_rating AND $record->averageRating()>0}}
	<span class="SG_byline">
	{template="rating" app="core" params="'small', $record->averageRating(), \IPS\Settings::i()->reviews_rating_out_of, $record->memberRating()" group="global"}
	</span>
{{endif}}	


  
  {{if count( $record->reactions() )>0}}
  <span class="SG_byline SG_hold_together"> {{if member.member_id}}<a href='{$record->url('showReactions')}' data-ipsDialog data-ipsDialog-title='{lang="see_who_reacted"}'>{{endif}}<i class='fa fa-line-chart'></i> {expression="count( $record->reactions() )"}{{if member.member_id}}</a>{{endif}}</span>
  {{endif}}
 
<span class="SG_byline SG_byline_last SG_hold_together">{lang="num_views_with_number" pluralize="$record->record_views"}</span>
  </div>
{{endif}}
  
    
  
</div>

 

Link to comment
Share on other sites

I already use this code in the past for understand how work Pages.

It's the original template in your code ? Try with it and remember to take a copy of your actual code in your laptop (with a app 'note') than you can use again if your new template doesn't work what you want. Or try it in local if you can it's better to try something without lost your work in your website.

 

Link to comment
Share on other sites

I have replaced the code as you advised, but when I remove the image field code, it displayed the text of all images.

Replaced codes are still there on live site, but revert the image field codes.

image.thumb.png.b9405bcb2ff8ee3e628956e6672c992b.png

 

And btw in backend, I truncate the number of images: 1, but still all images locations have been shown.

image.thumb.png.1dbcac831e5cf8689b13f4610bd6b7f2.png

Link to comment
Share on other sites

Oh ok... you use a custom uploader field. I never use it just the record image field. I’m not sure how you can use it with your custom uploader field. Maybe a member here can help with this. You can add your old code for the moment. I try to see it in my local test install later in this week if nobody can help with this. 

Link to comment
Share on other sites

@Gauravk I found an alternative for you, try it for see if that work (because with the devtool on safari can be different) 

Move all your div "ipsclearfix" under your div "ipsType_right SG_image_container ipsAreaBackground_light" 

<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: 60%;
">
<div class="ipsClearfix">
{{foreach $value as $image}}
  <img style="height: 160px; width: 240px;" align="center" src='{file="$image" extension="cms_Records"}'>
{{break;}}{{endforeach}}
</div>

 

change your img style by 

<img style="width: 100%;" align="center" src='{file="$image" extension="cms_Records"}'>

Adjust your padding-bottom or delete this style

<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: 3%;
">

 

Result 

909476561_Capturedcran2018-10-0208_55_51.thumb.png.beb9a6418afaf03fd09575a851a2456c.png

Link to comment
Share on other sites

Thanks a lot for your help and efforts, really appreciate it @scaz , you are a true star.

I have edited image field code to this:

<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: 60%;">
<div class="ipsClearfix">
{{foreach $value as $image}}
  <img style="width: 100%;" align="center" src='{file="$image" extension="cms_Records"}'>
{{break;}}{{endforeach}}
</div>

And then created new SG template and attached to business listing DB as I am using SG in other DB too but with standard record image, which is working good.

Then I deleted below codes from SG-new and it shows quite a lot of progress, but tiles are appearing one underneath each other rather than side by side.

<div class="ipsType_right SG_image_container ipsAreaBackground_light" style="padding-bottom: {{if settings.SuperGrid_aspect_ratio}}{setting='SuperGrid_aspect_ratio'}%{{else}}50%{{endif}};
{{if $record->record_image}}background-image:url('{{if settings.SuperGrid_image_use_thumbnail}}{file='$record->_record_image_thumb' extension='cms_Records'}{{else}}{file='$record->record_image' extension='cms_Records'}{{endif}}');{{elseif settings.SuperGrid_fallback_image}}background-image:url('{setting="SuperGrid_fallback_image_url"}');{{endif}}">

 

As im on live site, so revert to SG-standard until I hear next changes I need to make

image.thumb.png.9b2a784272878e6b3fbfb94ae2b232ff.png

Link to comment
Share on other sites

Thanks @newbie LAC you are a good luck charm buddy.

Unfortunately, your code edit resulted in squeezing images in the top right corner, so while undoing all code edits and attaching standard SG template, I undo half of the code in the image field and accidentally discovered what is really working with minimalistic code edits in Image upload field.

No SG template edit needed

No Code edit in custom.css

<div class="ipsClearfix">
{{foreach $value as $image}}
  <img style="width: 100%;" align="center" src='{file="$image" extension="cms_Records"}'>
{{break;}}{{endforeach}}
</div>

After custom.css edit

image.thumb.png.e7a080983ea8f1df909e8046cb53d40b.png

 

NOW FINALLY, ALL GOOD.

Thanks a lot @scaz and @newbie LAC for persistingly helping with this issue

image.thumb.png.e15c08777803d87dc5d2d7793ba671d6.png

Link to comment
Share on other sites

9 minutes ago, Gauravk said:

Unfortunately, your code edit resulted in squeezing images in the top right corner, so while undoing all code edits and attaching standard SG template, I undo half of the code in the image field and accidentally discovered what is really working with minimalistic code edits in Image upload field.

I did not tell you to edit the templates.

I read your first post, opened your forum and made changes

BTW

Now your block looks like

Pay attention on avatars baseline and images height

block.thumb.jpg.9f28e0474055d6fce24bdb8c1a4f946c.jpg

block2.thumb.jpg.8c2846d81a76461cf00be464f3db5492.jpg

With my changes (no need to edit templates, just add css)

block3.thumb.jpg.69289b8700a3dce14b90049d22bc35a1.jpg

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...