How to hide exact image in front-end from others?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
один год назад
Greetings!

I need some help.

I have a very small eShop with 14 products. I use version 4.30

I want to have following:
1. Hide image in front-end which has alt="hide" or title="hide"
2. Apply this rule only for Registered and Guest users, but do not apply for Admin
3. Prohibit google and other searching-systems to index hided images (which has alt="hide" or title="hide")

Thanks!
один год назад
I don't know if it can be done in general for alt="hide" or title="hide", but you can determine IsAdmin in .cshtml with razor code.

It's similar to this post
https://www.nopcommerce.com/en/boards/topic/48764/logged-in-customer-data-on-product-details-in-admin-area#193207
but check for IsAdmin:
var _customerService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Services.Customers.ICustomerService>();
var isInRole = _customerService.IsAdmin(customer);



(Note, that if you need to be logged in as Admin to see it, then Google won't see it ;)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.