BodyCssClass on initial content

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/5/2012 4:28:34 AM
Gravatar
Total Posts 40

BodyCssClass on initial content

Hello,

After reading http://www.mojoportal.com/configuring-initial-content.aspx I built successfully an initial content .config file. But the BodyCssClass is ignored. Is this option available?

By the way, i think that when using the page settings and configuration links on a page with a BodyCssClass beeing used, the class should be ignored. Because usually we have a different home page for instance, and it makes the page hard to configure and add features, ...etc.

Best regards,
João

11/5/2012 1:13:57 PM
Gravatar
Total Posts 18439

Re: BodyCssClass on initial content

Its case sensitive, you must do it like this:

bodyCssClass="mybodyclass"
menuCssClass="mymenucssclass"

not BodyCssClass or MenuCssClass

There is nothing we can do to make a css class ignored if it is rendered in the markup. Generally the page settings and page layout must use the same skin as the page for a number of reasons. We "could" make it not add the body class on those pages but I'm not sure others would agree with that. Usually the body class is just used as part of a CSS selector like:

.bodyclass div.someotherclass {}

so it should be possible to construct css rules that only affect things in the actual content without affecting the layout or settings page unless you want to.

Hope that helps,

Joe

11/5/2012 2:59:11 PM
Gravatar
Total Posts 2183

Re: BodyCssClass on initial content

Hi João,

We run into the custom Body Css Class causing isses on these pages every once in a while. We wouldn't want the current functionality to change for various reasons so we generally just use .CUSTOMCLASS.adminpage as a start of a selector to fix or reverse whatever needs to be different for on the layout and settings pages. For instance, if we made the center column narrow with our body css class, we would add this to bring it back to whatever it's width is supposed to be, in this case, 960px.

.narrowcenter.adminpage .center-nomargins { width: 960px; } 

Notice there is no space between .narrowcenter and .adminpage.

HTH,
Joe D.

11/6/2012 8:15:48 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Thanks Joe, i was missing the case sensitive.

Joe Davis, that worked very well ;) Thanks!

Best Regards,

João

11/7/2012 6:12:34 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Regarding the initial content, i am adding a gallery, but i want to have 3 settings as follows (height, width, nivoSlider):

<contentFeature
featureGuid="d572f6b4-d0ed-465d-ad60-60433893b401"
contentTitle="Slides"
contentTemplate=""
location="center"
sortOrder="1"
cacheTimeInSeconds="0"
contentInstaller="mojoPortal.Features.UI.ImageGalleryContentInstaller, mojoPortal.Features.UI"
configInfo="~/Setup/initialcontent/gallery/slides"
galleryWebImageHeightSetting="335"
galleryWebImageWidthSetting="970"
useNivoSlider="true"
/>

But the installer just ignores the options. What am i missing? ;)

EDIT: Forgot to mention that the images get copied into media/GalleryImages/... correctly but the imageGallery module looks for the images in /Data/Sites/1/GalleryImages/... so i guess the "media" is missing. And after instalation, if i click "configuration" while logged in as admin, it says i do not have the required permissions. Thanks in advance.

Best regards,

João

11/7/2012 8:48:09 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

I tried this code:

<contentFeature
featureGuid="d572f6b4-d0ed-465d-ad60-60433893b401"
contentTitle="Slides"
contentTemplate=""
location="center"
sortOrder="1"
cacheTimeInSeconds="0"
contentInstaller="mojoPortal.Features.UI.ImageGalleryContentInstaller, mojoPortal.Features.UI"
configInfo="~/Setup/initialcontent/gallery/slides"
showTitle="false"
>

<moduleSetting settingKey="GalleryWebImageHeightSetting" settingValue="335" />
<moduleSetting settingKey="galleryWebImageWidthSetting" settingValue="970" />
<moduleSetting settingKey="UseNivoSlider" settingValue="true" />

</contentFeature>

But the result was the same. Options get ignored.

11/7/2012 9:06:04 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

So i've been looking at the ImageGalleryContentInstaller code and as i see it, it only expects configInfo to be the folder to copy. I think it should be an XML like FeedManagerContenInstaller for example, so that we could have a <folder folderName="myfolder" /> and then <moduleSetting .../> in that XML.

What do you think?

Best regards,
João

11/7/2012 10:34:26 AM
Gravatar
Total Posts 18439

Re: BodyCssClass on initial content

These content installers were developed primarily to support my needs to populate the demo site and I shared them in case others find them useful but they are not comprehensive ways to configure all possible features in all possible ways. I did not have a need for module settings for my purposes in populating the image gallery so I did not implement support for that.

If you would like to submit code changes to add functionality to it I will review your changes and consider integrating them, but it isn't a top priority for me at the moment to do it myself. If you decide to do it then make sure you put comments around your changes to make it easy to find them and send me the modified files.

Best,

Joe

11/8/2012 9:17:11 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Thanks Joe, As soon as i update the code i will send it to you.

I have just one issue remaining regarding the initial content.

I create a Blog, with 3 posts using the initialcontent. I run the setup and all looks ok. But i click the rssfeed link on the blog and the page is empty. If i edit one post (just edit and save, don't change anything) and then access the rssfeed, it shows all 3 posts. This also works if i add a 4th post instead of editing one of the 3. Do you have any clues as to why this is happening?

Thanks in advance.

Best Regards,
João

11/8/2012 9:35:05 AM
Gravatar
Total Posts 18439

Re: BodyCssClass on initial content

Hi João,

The blog feed problem should be fixed in the latest code if you are working from the source code repository. Previously the friendly url for the feed was only created after creating a post through the UI but in the latest code we no longer need the friendly url for feeds. The friendly url was only needed because some feed readers don't like there to be more than 2 query string params in the feed url, so we solved it by combining the params together.

Best,

Joe

11/9/2012 10:38:36 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Hi Joe,

Yes i am working with the source version. I just updated the code and now am getting:

\Blog\Controls\PostList.ascx(63): error CS0103: The name 'UseProfileLink' does not exist in the current context

when i access a page with the blog installed.

Best regards,

João

11/9/2012 11:11:38 AM
Gravatar
Total Posts 18439

Re: BodyCssClass on initial content

Did you rebuild the solution and visit the setup page after updating to the latest code?

11/9/2012 12:44:12 PM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Thanks Joe. You are the man ;)

Good news: I double checked and somehow i did not update the setup folder. So now i can see posts again!!!

Bad news: my RSS remains empty until i edit/add a post :/

Any thoughts?

Best regards,
João

11/9/2012 12:54:44 PM
Gravatar
Total Posts 2183

Re: BodyCssClass on initial content

If you don't have any posts, it makes sense that the RSS feed is empty.

Thanks,
Joe D.

11/9/2012 12:54:56 PM
Gravatar
Total Posts 18439

Re: BodyCssClass on initial content

If the blog has posts the feed should have posts. I just tested it here creating a new site and it worked for me, I click the feed link and I see the post that was created during setup.

Best,

Joe

 

11/12/2012 11:38:37 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Hi there,

This is what i am using to create the initial blog:

<?xml version="1.0" encoding="utf-8" ?>
<blog>

<moduleSetting settingKey="BlogEditorHeightSetting" settingValue="350" />
<moduleSetting settingKey="RelatedItemsToShow" settingValue="0" />
<moduleSetting settingKey="UseExcerptInFeedSetting" settingValue="true" />
<moduleSetting settingKey="BlogExcerptLengthSetting" settingValue="250" />
<moduleSetting settingKey="BlogExcerptSuffixSetting" settingValue="" />
<moduleSetting settingKey="BlogMoreLinkText" settingValue="" />
<moduleSetting settingKey="BlogEntriesToShowSetting" settingValue="10" />
<moduleSetting settingKey="BlogShowFeedLinksSetting" settingValue="false" />
<moduleSetting settingKey="BlogShowAddFeedLinksSetting" settingValue="false" />
<moduleSetting settingKey="AddFeedDiscoveryLink" settingValue="false" />
<moduleSetting settingKey="MaxFeedItems" settingValue="20" />
<moduleSetting settingKey="BlogRSSCacheTimeSetting" settingValue="120" />
<moduleSetting settingKey="RSSAddSignature" settingValue="false" />
<moduleSetting settingKey="RSSAddCommentsLink" settingValue="false" />
<moduleSetting settingKey="BlogShowStatisticsSetting" settingValue="false" />
<moduleSetting settingKey="ShowNextPreviousLinks" settingValue="false" />
<moduleSetting settingKey="BlogAllowComments" settingValue="false" />

<posts>

<post title="My first news!">
<description>
<![CDATA[
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eu orci at nulla aliquet laoreet. Donec vel tellus ut purus egestas placerat. Curabitur ac ante purus. Curabitur lectus elit, convallis sed aliquet at, rutrum eu tortor. Integer euismod interdum nisl vehicula tristique. Integer nec justo sit amet lorem consectetur auctor. Praesent magna ipsum, dapibus ut blandit at, mollis in libero. Fusce lorem sem, aliquam eu dapibus vulputate, egestas et libero. Nulla lacus eros, tristique non cursus ac, laoreet quis nisl. Nullam justo neque, commodo vel consequat et, blandit non nulla. Donec eu tincidunt eros. Aliquam in tortor non lacus cursus elementum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eu orci at nulla aliquet laoreet. Donec vel tellus ut purus egestas placerat. Curabitur ac ante purus. Curabitur lectus elit, convallis sed aliquet at, rutrum eu tortor. Integer euismod interdum nisl vehicula tristique. Integer nec justo sit amet lorem consectetur auctor. Praesent magna ipsum, dapibus ut blandit at, mollis in libero. Fusce lorem sem, aliquam eu dapibus vulputate, egestas et libero. Nulla lacus eros, tristique non cursus ac, laoreet quis nisl. Nullam justo neque, commodo vel consequat et, blandit non nulla. Donec eu tincidunt eros. Aliquam in tortor non lacus cursus elementum.
</p>
]]>
</description>
<excerpt>
<![CDATA[
<p><img alt="" src="/Data/Sites/1/imagens_noticias/c.jpg" height="215" width="324" /></p> <p class="texto">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eu orci at nulla aliquet laoreet. Donec vel tellus ut purus egestas placerat. Curabitur ac ante purus. Curabitur lectus elit, convallis sed aliquet at, rutrum eu tortor. Inte</p>
]]>
</excerpt>
</post>
</posts>
</blog>

And like i said, using the latest code and accessing the blog page, where i see the post, and then click the rss link (blog2rss.aspx) and see it empty. If i go back and edit that post, and just save it, i then go to the same rss link and it shows the item.

Best regards,
João

11/12/2012 11:44:06 AM
Gravatar
Total Posts 18439

Re: BodyCssClass on initial content

If you are using the latest code the feed url should not be "blog2rss.aspx", it should be in the format /Blog/RSS.aspx?p=x~y~z

11/12/2012 12:45:11 PM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Thanks Joe.

Very helpfull as usual ;)

Just one observation: while trying to reinstalls several times (trying different content, experimenting, etc), i always have to delete my gallery files from data/sites/1/media/GalleryImages/... or i get an error while installing the initial content saying that the images i am trying to copy using the imagegallery content installer already exist. Perhaps they should just be either deleted or ignored.

Thank you again for your time.
Best regards,
João

11/22/2012 9:07:50 AM
Gravatar
Total Posts 40

Re: BodyCssClass on initial content

Sugested fix for the content installer already exists:

File: IOHelper.cs in mojoPortal.Web.Framework.IOHelper

Line 293:

File.Copy(file, dest);

Replace with:

File.Copy(file, dest, true); //overwrite existent files

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