How to make a picture change on reload in category fields?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I notice that on the edit category and home page thingy in the nopC that I can insert a picture. I want to insert a picture that changes on each reload.

What would be the best method to create a picture set that changes on each reload?

Thank you
11 years ago
Jackluv wrote:
I notice that on the edit category and home page thingy in the nopC that I can insert a picture. I want to insert a picture that changes on each reload.

What would be the best method to create a picture set that changes on each reload?

Thank you


I would do it by storing the category images in a specific folder, with file naming having the following pattern:

category-[catId]-[sequenceNumber].[extension]

Then in the View, write some simple codes to randomly pick the picture specific to that category. :D
11 years ago
wooncherk wrote:
I notice that on the edit category and home page thingy in the nopC that I can insert a picture. I want to insert a picture that changes on each reload.

What would be the best method to create a picture set that changes on each reload?

Thank you

I would do it by storing the category images in a specific folder, with file naming having the following pattern:

category-[catId]-[sequenceNumber].[extension]

Then in the View, write some simple codes to randomly pick the picture specific to that category. :D


Any idea where I get that simple codes?
11 years ago
Jackluv wrote:
I notice that on the edit category and home page thingy in the nopC that I can insert a picture. I want to insert a picture that changes on each reload.

What would be the best method to create a picture set that changes on each reload?

Thank you

I would do it by storing the category images in a specific folder, with file naming having the following pattern:

category-[catId]-[sequenceNumber].[extension]

Then in the View, write some simple codes to randomly pick the picture specific to that category. :D

Any idea where I get that simple codes?


It should be simple enough that you can write it yourself, something like:

<img src="@Url.UrlContent("~/PATH/TO/PICTURE/PICTURE_NAME.jpg")" />

Of course you need to inject some randomness into it. :D
11 years ago
Java script is what I use? Or html? What does the edit home page accept?

If I knew that, I could google for the code. I do have dreamweaver, I could wysiwyg the code in there and copy/paste it into the thingy.
11 years ago
Jackluv wrote:
Java script is what I use? Or html? What does the edit home page accept?

If I knew that, I could google for the code. I do have dreamweaver, I could wysiwyg the code in there and copy/paste it into the thingy.


In CSHTML you can inject C# code. So the randomness can be taken care by C#. :D
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.