SPECIAL OFFER: Only $69 for access to everything in OSTraining for 1 year! You save $75!  1
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

Rewrite Results in Views

5 years 7 months ago - 5 years 7 months ago #122130 by iqsafe
Rewrite Results in Views was created by iqsafe
In Drupal 6, I used to use something like
<div class="centertitle">[title]</div>
, but it is no longer working for me the same way in Drupal 7. Am I missing something. Can you help remove my confusion please. You may see the view on the front page with titles left aligned not centered at suquna.com. I made a css class at mytheme.css which is simply the
.centertitle {
text-align: center
}

Please Log in to join the conversation.

5 years 7 months ago #122137 by Valentin
Replied by Valentin on topic Rewrite Results in Views
Hi iqsafe,
May we have a link to your site with step by step details to reach the issue?

Looking forward to help you

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

5 years 7 months ago - 5 years 7 months ago #122140 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views
Yes sure. The URL is suquna.com . I created a view and called it Mixed Ads. I added two fields to the view one is the main image and the other was the title field. I tried to center the title under the image in a grid view. For this centering I attempted to use the Rewrite results method by wrapping the [title] field with an css class. If you need my user name name and pass please let me know. Please let me know if these information still insufficient. Thanks.

Please Log in to join the conversation.

5 years 7 months ago - 5 years 7 months ago #122145 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views
If you would like to ask me for my Drupal site credentials, please feel free. Have a nice time.

Please Log in to join the conversation.

5 years 7 months ago #122180 by steve
Replied by steve on topic Rewrite Results in Views
Hi iqsafe

I think the key here is that your CSS is being overwritten.

I used Chrome developer tools to take a look at the CSS. I changed the text-align and it worked. It looks like the class is col-1 col-first:

This message has an attachment image.
Please log in or register to see it.

The following user(s) said Thank You: iqsafe

Please Log in to join the conversation.

5 years 7 months ago #122185 by Valentin
Replied by Valentin on topic Rewrite Results in Views
Hi iqsafe,

I recommend you to check this tutorial to see which CSS selectors to use to center those elements.

You can try something like this:
.views-field-field-main-image,
.views-field-title {
    text-align: center;
}

Looking forward to help you

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
The following user(s) said Thank You: iqsafe

Please Log in to join the conversation.

5 years 7 months ago #122230 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views

Valentin wrote: Hi iqsafe,

I recommend you to check this tutorial to see which CSS selectors to use to center those elements.

You can try something like this:

.views-field-field-main-image,
.views-field-title {
    text-align: center;
}

Looking forward to help you

Kind regards,
Valentín


Thanks for both you @Steve and @Valentin. Valentin class worked very well but the one brought by Steve did not work, though it worked for you on the Chrome tracking tool. Thank you for the Tutorial which is very important. However, I think You and Steve missed to know what I meant by my question. I meant how to change the style of a field from the view itself by utilizing a special class in my case was called (centertitle). Please see the inserted picture. I wonder why this approach that I am talking about is not working. I used to use it in Drupal 6 and the usage did not change in Drupal 7.

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 7 months ago #122238 by Valentin
Replied by Valentin on topic Rewrite Results in Views
I tested in local, and your approach worked in my case.
I edited "Content: Title" and did what you displayed in the screenshot.

End result:


Clear cache to see if makes a difference.

Kind regdards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

This message has attachments images.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 7 months ago #122242 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views
So there is nothing wrong in this approach, but could only prove that there is something wrong on my side. Thank you so much for your time.

Please Log in to join the conversation.

5 years 7 months ago #122249 by Valentin
Replied by Valentin on topic Rewrite Results in Views
Cool! Let us know if you need more help on this.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
The following user(s) said Thank You: iqsafe

Please Log in to join the conversation.

5 years 7 months ago #122295 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views
Is Chrome developer tool an extension or built in? Thanks

Please Log in to join the conversation.

5 years 7 months ago #122297 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views

iqsafe wrote: Is Chrome developer tool an extension or built in? Thanks


I am asking because when I am on the Google Chrome browser and using the developer tool I just discovered built in, highlight does not move to the class when I hover over an image on the front page. Thanks

Please Log in to join the conversation.

5 years 7 months ago - 5 years 7 months ago #122298 by Valentin
Replied by Valentin on topic Rewrite Results in Views
Hi iqsafe,

Do you mean this ? If so, is a built-in tool included inside Chrome browser useful to debug site issues. It's similar to Firebug addon for Firefox browser.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

5 years 7 months ago #122302 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views
Yes I mean this.

but firebug for Chrome interact with the built in tool? because when I click on inspect I suppose that highlights begin to show up on different section as I hover variantly from part to part. But this does not happen ... Am I missing something. Thanks.

Please Log in to join the conversation.

5 years 7 months ago #122305 by Valentin
Replied by Valentin on topic Rewrite Results in Views
Chrome Inspect tool and Firebug are separate tools that does a similar work.

If you're using Chrome, I recommend stick with native Inspect tool (not firebug), however in Firefox, Firebug is the popular choice.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
The following user(s) said Thank You: iqsafe

Please Log in to join the conversation.

5 years 7 months ago #122309 by iqsafe
Replied by iqsafe on topic Rewrite Results in Views
You said the right things at the right time (there must be an English idiom for this). With this reply from you, you cleared my confusion. Thanks so much

Please Log in to join the conversation.

5 years 7 months ago #122310 by Valentin
Replied by Valentin on topic Rewrite Results in Views
I'm happy to help! :)

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
The following user(s) said Thank You: iqsafe

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!