Random Image

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
12/31/2008 2:32:31 PM
Gravatar
Total Posts 117

Random Image

I would like to have a random image pulled up within the skin - is there any mechanism built in that could be used to do this or do I have to resort to Java

 

Neil

1/1/2009 10:04:44 AM
Gravatar
Total Posts 18444

Re: Random Image

We do't have an image rotator per se, but we have an Ad Rotator, not sure how it would work without links but worth a try. You could also either use javascript in your layout.master file of the skin or google asp.net image rotator for other possibilities.

Best,

Joe

1/1/2009 10:08:46 AM
Gravatar
Total Posts 117

Re: Random Image

is there an example of how to use the ad rotator anywhere  >

1/1/2009 10:32:38 AM
Gravatar
Total Posts 18444

Re: Random Image

The blog post I linked to has the needed info.

1. Create a text/xml file in the format shown in the post, put it in you App_Data folder. This file specifies the ad images and links and click tracking. You can leave out the OnClientClick. I'm not positive what will happen if you leave out the navigateurl, hopefully it will just work, or you could put your site root as the url.

2. add this to your layout.master and specify the path to your ad file:

<mp:AdRotator id="ads1" runat="server" AdvertisementFile="~/App_Data/mojoads.ads" />

So the ads in rotation at the bottom of this site are coming from /App_Data/mojoads.ads, and the line above is exactly what I have in my layout.master file.

Hope it helps,

Joe

1/1/2009 10:36:40 AM
Gravatar
Total Posts 117

Re: Random Image

Thanks - I had understood the XML file bit - it was the

<mp:AdRotator id="ads1" runat="server" AdvertisementFile="~/App_Data/mojoads.ads" /> 

bit I missed - unfortunately I am not really a .net developer so struggle with some of the obvious stuff.

 

Thanks again

 

Neil

1/18/2009 11:05:29 AM
Gravatar
Total Posts 117

Re: Random Image

Is there a way of doing this on one page rather than all of them.

Neil

1/18/2009 11:19:20 AM
Gravatar
Total Posts 18444

Re: Random Image

Create 2 skins one with the ad rotator and one without. In site Settings enable skins per page, then set the skin without as the default skin for the site and go to the page settings of the page where you do want it and set the skin to the one with the ad rotator.

Hope it helps,

Joe

1/18/2009 11:39:50 AM
Gravatar
Total Posts 117

Re: Random Image

I will try that - would it be possible to add the rotator as a module so it can be dropped on a page?

Neil

1/18/2009 12:21:27 PM
Gravatar
Total Posts 18444

Re: Random Image

It would be trivial to make one based on the hello world examples. Just chop out the UpdatePanel and add the adrotator the same as it is added in layout.master.

You can download the hello world examples and modify, or just paste this into a text file and name it yourcustomname.ascx and install it as indicated in the hellow world article.

Hope it helps,

Joe

Example is from here down:

<%@ Page Language="C#" ClassName="MyCustomAdRotatorModule.ascx" Inherits="mojoPortal.Web.SiteModuleControl" %>

<%@ Import Namespace="mojoPortal.Business" %>
<%@ Import Namespace="mojoPortal.Business.WebHelpers" %>
<%@ Import Namespace="mojoPortal.Web.Framework" %>
<%@ Import Namespace="mojoPortal.Web.Controls" %>


<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{


}


</script>

<<mp:AdRotator id="ads1" runat="server" AdvertisementFile="~/App_Data/mojoads.ads" />

1/18/2009 1:23:20 PM
Gravatar
Total Posts 117

Re: Random Image

thanks joe

 

Neil

You must sign in to post in the forums. This thread is closed to new posts.