Trickstar
2012-07-06T19:58:33Z
I am trying to change the main file that determines the sites main layout so I can add my own design to the forum on my site. I was hoping to find a "Edit Themes" type thing in the admin CP like phpBB but was sadly disappointed 😞 so I need to find the main file for the forums display so I can remake my forums design to the way I want it. Any help would be greatly appreciated.
Sponsor
Trickstar
2012-07-06T21:12:10Z
Nevermind, I figured out its Default.aspx, but I don't really like how I can't create HTML based on which theme is chosen, is there any global variables that tell which theme is selected so I can use something like (the following is pseudocode):

<% if (themeChoosen == "Default") {
%>
 <!-- Display HTML for default -->
<% }
if (themeChoosen == "Default2")
{
%>
<!-- Display HTML for Default2 -->
<% } %>

to generate HTML based on what theme is chosen? Thanks in advance.
squirrel
2012-07-06T22:12:33Z
Themes are controlled by their theme.css files in each theme folder -- that is what determines the layout. ..

Individual page controls are located in their ASCX files but are not 'theme independent' -- they output the same code regardless of theme. The different stuff based on theme is in the individual theme folders...
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
Trickstar
2012-07-07T00:05:33Z
I see but is there any way to generate HTML on the default.aspx by determining the selected theme? I would think some kind of variable would be used to determine which theme files to load.
squirrel
2012-07-07T02:01:58Z
You will most likely have to have the source code version of the application, along with Visual Studio 2010 to make those kind of changes.  tha_watcha is the UI/UX guru -- so he will have to jump in to provide more detailed information...
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
tha_watcha
2012-07-07T03:46:03Z
Originally Posted by: Trickstar 

I see but is there any way to generate HTML on the default.aspx by determining the selected theme? I would think some kind of variable would be used to determine which theme files to load.



That would be something like this.

<% if (YafContext.Current.Get<ITheme>().ThemeFile == "cleanslate.xml") {
%>
 <!-- Display HTML for cleanslate theme -->
<% }
       else if (YafContext.Current.Get<ITheme>().ThemeFile == "mytheme.xml")
{
%>
<!-- Display HTML for my theme -->
<% } %>

But you cant control much from the default.aspx file. If you want to change the layout or whats displayed take a look at the MobileTheme it has a folder called "MobilePages" you can override each control (ascx file) from your theme.
UserPostedImage
Trickstar
2012-07-07T16:12:15Z
Thanks, it works fine, I got what I want from the default.aspx so far because the forum is all percentages so I just had to embed it into a DIV to make it fixed width so I could add a banner and bottom bar that changes depending on the theme, though I may need to edit those files eventually if I feel a desire to edit more, I'll post back if I need any help. Thanks again.
Trickstar
2012-07-08T17:38:50Z
Whats the file that contains the guides on the bottom of each page? (New Posts No New Posts Forum Locked ect.) In the theme file if I change the .yafnet td color to white (because my background makes black hard to see) it changes all other text in the forum to white too, which the background to the individual forum columns are still white so I need to go in and change the container of the Guides to a different class so I can just change them without altering the whole page.
squirrel
2012-07-08T18:13:23Z
EDIT/DELETED --
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
tha_watcha
2012-07-08T22:59:09Z
Originally Posted by: Trickstar 

Whats the file that contains the guides on the bottom of each page? (New Posts No New Posts Forum Locked ect.) In the theme file if I change the .yafnet td color to white (because my background makes black hard to see) it changes all other text in the forum to white too, which the background to the individual forum columns are still white so I need to go in and change the container of the Guides to a different class so I can just change them without altering the whole page.



its controls/ForumIconLegend.ascx. Currently there a no Css Classes attached to it, maybe i should add a forumIconLegend Css class to the Table.


UserPostedImage
Trickstar
2012-07-09T01:35:21Z
Originally Posted by: tha_watcha 

Originally Posted by: Trickstar 

Whats the file that contains the guides on the bottom of each page? (New Posts No New Posts Forum Locked ect.) In the theme file if I change the .yafnet td color to white (because my background makes black hard to see) it changes all other text in the forum to white too, which the background to the individual forum columns are still white so I need to go in and change the container of the Guides to a different class so I can just change them without altering the whole page.



its controls/ForumIconLegend.ascx. Currently there a no Css Classes attached to it, maybe i should add a forumIconLegend Css class to the Table.



Thanks, and that would be great :)

Here is my new version of ForumIconLegend.ascx:
<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false"
	Inherits="YAF.Controls.ForumIconLegend" Codebehind="ForumIconLegend.ascx.cs" %>
<table style="padding: 2px; margin: 2px" width="100%">
	<tr>
		<td>
			<YAF:ThemeImage ID="ForumNewImage" Style="vertical-align: middle" runat="server"
				ThemeTag="FORUM_NEW" />
			<span class="YAF_iconLegend"><YAF:LocalizedLabel ID="NewPostsLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="New_Posts" /></span>
			<YAF:ThemeImage ID="ForumRegularImage" Style="vertical-align: middle" runat="server"
				ThemeTag="FORUM" />
			<span class="YAF_iconLegend"><YAF:LocalizedLabel ID="NoNewPostsLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="No_New_Posts" /></span>
			<YAF:ThemeImage ID="ForumLockedImage" Style="vertical-align: middle" runat="server"
				ThemeTag="FORUM_LOCKED" />
			<span class="YAF_iconLegend"><YAF:LocalizedLabel ID="ForumLockedLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="Forum_Locked" /></span>
		</td>
	</tr>
</table>

tha_watcha
2012-07-09T09:55:39Z
Ok here is what i did replaced the table with an Nested list and add a css class.

<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false"
	Inherits="YAF.Controls.ForumIconLegend" Codebehind="ForumIconLegend.ascx.cs" %>

<div class="forumIconLegend">
	<ul>
	    <li>
	        <YAF:ThemeImage ID="ForumNewImage" runat="server" LocalizedTitlePage="ICONLEGEND"
				LocalizedTitleTag="New_Posts" ThemeTag="FORUM_NEW" />&nbsp;
		    <span><YAF:LocalizedLabel ID="NewPostsLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="New_Posts" /></span>
        </li>
		<li>
		    <YAF:ThemeImage ID="ForumRegularImage" runat="server"
				ThemeTag="FORUM" LocalizedTitlePage="ICONLEGEND" LocalizedTitleTag="No_New_Posts" />&nbsp;
		    <span><YAF:LocalizedLabel ID="NoNewPostsLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="No_New_Posts" /></span>
		</li>
		<li>
		    <YAF:ThemeImage ID="ForumLockedImage" runat="server"
				ThemeTag="FORUM_LOCKED" LocalizedTitlePage="ICONLEGEND" LocalizedTitleTag="Forum_Locked" />&nbsp;
		    <span><YAF:LocalizedLabel ID="ForumLockedLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="Forum_Locked" /></span>
	    </li>
	</ul>
</div>

css code from the forum.css

/* forum Icon Legend */
.yafnet .forumIconLegend {
	padding: 2px; 
	margin: 2px;
	width:100%
}
.yafnet .forumIconLegend li {
	list-style:none;
	float:left
}

.yafnet .forumIconLegend li img {
	vertical-align:middle
}

UserPostedImage
Trickstar
2012-07-10T17:07:52Z
Originally Posted by: tha_watcha 

Ok here is what i did replaced the table with an Nested list and add a css class.

<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false"
	Inherits="YAF.Controls.ForumIconLegend" Codebehind="ForumIconLegend.ascx.cs" %>

<div class="forumIconLegend">
	<ul>
	    <li>
	        <YAF:ThemeImage ID="ForumNewImage" runat="server" LocalizedTitlePage="ICONLEGEND"
				LocalizedTitleTag="New_Posts" ThemeTag="FORUM_NEW" />&nbsp;
		    <span><YAF:LocalizedLabel ID="NewPostsLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="New_Posts" /></span>
        </li>
		<li>
		    <YAF:ThemeImage ID="ForumRegularImage" runat="server"
				ThemeTag="FORUM" LocalizedTitlePage="ICONLEGEND" LocalizedTitleTag="No_New_Posts" />&nbsp;
		    <span><YAF:LocalizedLabel ID="NoNewPostsLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="No_New_Posts" /></span>
		</li>
		<li>
		    <YAF:ThemeImage ID="ForumLockedImage" runat="server"
				ThemeTag="FORUM_LOCKED" LocalizedTitlePage="ICONLEGEND" LocalizedTitleTag="Forum_Locked" />&nbsp;
		    <span><YAF:LocalizedLabel ID="ForumLockedLabel" runat="server" LocalizedPage="ICONLEGEND"
				LocalizedTag="Forum_Locked" /></span>
	    </li>
	</ul>
</div>

css code from the forum.css

/* forum Icon Legend */
.yafnet .forumIconLegend {
	padding: 2px; 
	margin: 2px;
	width:100%
}
.yafnet .forumIconLegend li {
	list-style:none;
	float:left
}

.yafnet .forumIconLegend li img {
	vertical-align:middle
}



You should also make it in the new version that the ForumIconLegend and the legend on the forum pages have the same CSS class so that they can be changed at the same time.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved