Topstory

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Topstory

Postby Xevor » Mon Aug 15, 2005 2:45 pm

Hello everyone,

After searching and searching I found out how to make a 'sticky' news for my website with Coranto. But now I have a problem.

What I have done is this:
I have a couple of profiles. Three of them are for the news.
One for maginot linking - this works perfect
One to have listed the last 20 headlines - this works perfect
One to have a sticky news - this works like I want.

I have three news styles.
One for the maginot linking
One for the headlines
And one for the sticky news

This is the code of the Default Headline news style (this one is used for the sticky news aka topstory)
Code: Select all
<If: Field: CustomField_topstory eq "1">
<center><b><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><center><Field: CustomField_fullsubject></center></font></b>
</center>
<If: Field: CustomField_image><center><br><img src="<FilePath: CustomField_image>">
</center></if>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"><Field: CustomField_shortstory></font>          <div align="center"></div>
<font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<MaginotURL: Ziggy>">Read more...</a></font>
</If>


I also have made a news field in my submit news. What I wanted was that when I checked that field the news would become a sticky news and when it is unchecked the old sticky news would still be there and the new news would be added to the latest news headlines.

Now the problem is that submit news tries to put every new news in the sticky.txt file. This is my problem. If I have unchecked the field you will not see anything but a newsid in sticky.txt but when you have checked the field you will see the newsid + the news. What I basically want is that when I have the field unchecked that submit news doesn't try AT ALL to write anything in sticky.txt. I thought maybe there is a code to write in the news style like:
"<If not equel>
then leave sticky.txt alone
</if>"

Lol is there such a code :D

I hope someone understand my problem
Thanks!
Xevor
 
Posts: 9
Joined: Fri Aug 12, 2005 6:55 pm

Re: Topstory

Postby Parahead » Mon Aug 15, 2005 3:50 pm

Xevor wrote:Now the problem is that submit news tries to put every new news in the sticky.txt file. This is my problem. If I have unchecked the field you will not see anything but a newsid in sticky.txt but when you have checked the field you will see the newsid + the news. What I basically want is that when I have the field unchecked that submit news doesn't try AT ALL to write anything in sticky.txt. I thought maybe there is a code to write in the news style like:
"<If not equel>
then leave sticky.txt alone
</if>"
What I don't understand is where does the newsid comes from, it doesn't appear to be in your style? Is it because you have the option "Anchor Tags?" set to Yes for the profile, or? In that case, set it to No would be the solution and replicate the anchor tag in the style inbetween the If-statements... If it isn't because of that, please elaborate a little about the newsid part.

As a side note the inner If-statement checking for the image field uses </if> when it should read </If>

Another side note, a result of fixing this would be if you have first placed a newsitem in the sticky profile and then remove all, the output file will still contain the last one. Check out the Empty Profile addon at my site which may be the solution for that...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Xevor » Mon Aug 15, 2005 6:01 pm

I changed the news style and the profile. The anchor settings are now OFF and I changed my news style like you said.

But I don't know what you mean with elaborate the newsid part. What do I need to elaborate?

I have found a solution although this one is not very simple. Immediately after I post a "sticky" news then I can go and disable the topstory profile so the news won't get changed anymore and the file will still have the same news in it. But then again for every sticky news I have to do this over and over again. There must be a solution to do it much easier.

I have downloaded and enabled the EmptyProfile addon but I don't know how and where to use it. I don't see EmptyProfile anywhere in the administration.
Xevor
 
Posts: 9
Joined: Fri Aug 12, 2005 6:55 pm

Postby Parahead » Mon Aug 15, 2005 7:27 pm

Xevor wrote:I changed the news style and the profile. The anchor settings are now OFF and I changed my news style like you said.

But I don't know what you mean with elaborate the newsid part. What do I need to elaborate?
I made an assumption of what was causing the newsid to be printed since I could not see anything in the style that would cause the newsid to be printed out. Hence I refered to the Anchor Tag setting. If that solved the problem there is no need to elaborate, that was only a request if it *didn't* solve the problem with the newsid. Has it?

Xevor wrote:I have found a solution although this one is not very simple. Immediately after I post a "sticky" news then I can go and disable the topstory profile so the news won't get changed anymore and the file will still have the same news in it. But then again for every sticky news I have to do this over and over again. There must be a solution to do it much easier.
I agree that this sounds like a very cumbersome solution. I thought I understand what you wanted to achive but now I am not that sure anymore... I think it this line I just don't understand:
What I wanted was that when I checked that field the news would become a sticky news and when it is unchecked the old sticky news would still be there and the new news would be added to the latest news headlines.


Xevor wrote:I have downloaded and enabled the EmptyProfile addon but I don't know how and where to use it. I don't see EmptyProfile anywhere in the administration.
Please forget about this addon for now, that was a remark about a future problem if we would have solved the problem as I thought. Sorry if I made things confusing...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Xevor » Mon Aug 15, 2005 7:56 pm

Parahead wrote:
Xevor wrote:I changed the news style and the profile. The anchor settings are now OFF and I changed my news style like you said.

But I don't know what you mean with elaborate the newsid part. What do I need to elaborate?
I made an assumption of what was causing the newsid to be printed since I could not see anything in the style that would cause the newsid to be printed out. Hence I refered to the Anchor Tag setting. If that solved the problem there is no need to elaborate, that was only a request if it *didn't* solve the problem with the newsid. Has it?

Xevor wrote:I have found a solution although this one is not very simple. Immediately after I post a "sticky" news then I can go and disable the topstory profile so the news won't get changed anymore and the file will still have the same news in it. But then again for every sticky news I have to do this over and over again. There must be a solution to do it much easier.
I agree that this sounds like a very cumbersome solution. I thought I understand what you wanted to achive but now I am not that sure anymore... I think it this line I just don't understand:
What I wanted was that when I checked that field the news would become a sticky news and when it is unchecked the old sticky news would still be there and the new news would be added to the latest news headlines.


Xevor wrote:I have downloaded and enabled the EmptyProfile addon but I don't know how and where to use it. I don't see EmptyProfile anywhere in the administration.
Please forget about this addon for now, that was a remark about a future problem if we would have solved the problem as I thought. Sorry if I made things confusing...


Yes the newsid thing is solved now. Thanks for that. Now about the part that you don't understand.

With the hack "Add news field or something" I made a checkbox like this Image in the Submit News page with the text TopStory. That means that if that checkbox is selected the news will be sticky and if not it will not be a sticky news it will just be a headline news just like all the other news.

I have the URL for you if you want to check my website http://www.irangoals.com/site

The problem is that if I check the checkbox the news will be written in sticky.txt but when I don't select the checkbox the old news in sticky.txt will get deleted and I will not see any sticky news on my homepage.
Xevor
 
Posts: 9
Joined: Fri Aug 12, 2005 6:55 pm

Postby Parahead » Wed Aug 17, 2005 8:08 am

Xevor wrote:The problem is that if I check the checkbox the news will be written in sticky.txt but when I don't select the checkbox the old news in sticky.txt will get deleted and I will not see any sticky news on my homepage.
Isn't this the desired behaviour? Only the news which you have marked as sticky with the sticky checkbox should appear as sticky?

Or don't I understand? Are you saying that if you have two news, both set to be sticky and if you uncheck *one* of them, both disapear from the sticky.txt file?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Xevor » Wed Aug 17, 2005 2:08 pm

Yes that is what I want but that is not what is happening.

For example!
I have not yet any news on my homepage. Then I want to post a Topstory news. The topstory news is "testtest"

My homepage will look like this:
testtest
-------
testtest

But then when I add an other news without the checked checkbox of Topstory a news called "test4". I will see this:

-------
test4
testtest

Somehow the sticky news will get deleted.
Xevor
 
Posts: 9
Joined: Fri Aug 12, 2005 6:55 pm

Postby Dale Ray » Wed Aug 17, 2005 4:37 pm

Am I correct that you are using ONE profile to create the headline list for you page?

There are two solutions to this problem:

One:

Use TWO profiles. In one profile use a style that only includes the items with the box checked.
Code: Select all
<If: Custom_Field_topstory>your code here</If>


For the other use a style that only includes the items without the box checked.
Code: Select all
<If: Custom_Field_topstory eq 0>your code here</If>

that is a zero after the eq


The output from both profiles are included in you page.

You can also use the Filter By Field addon to include and exclude items by the field value if you don't want to use if statements.

Two:

Use the sortorders addon to put the items with the topstory box at the beginning of the news when news is built.

Sortorders allows you to sort by two fields. Sort descending by the topstory field and then by whatever second field you want. This will put all of the items with the topstory field checked (value is one) before the items with the topstory field unchecked (value is zero). Get sortorders from Parahead's site.

You can then use the IsNewValue addon to check to see when the value changes so you can put in a header above each section of news.

Your problem (I think) is that with only one profile the topstory items will get mixed in with everything else when you only sort on one field.

Get the addons mentioned here from Parahead's site.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby Parahead » Wed Aug 17, 2005 6:20 pm

Xevor wrote:I have not yet any news on my homepage. Then I want to post a Topstory news. The topstory news is "testtest"

My homepage will look like this:
testtest
-------
testtest

But then when I add an other news without the checked checkbox of Topstory a news called "test4". I will see this:

-------
test4
testtest

Somehow the sticky news will get deleted.
What are your "Filter By Number" setting set to for the sticky profile? Could it be that you have it set to 1? If so, leave that field blank and create a counter within the style instead... *Or* you use the Filter-By-Field addon.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Xevor » Thu Aug 18, 2005 12:30 pm

Thank you all for your help!

The filter by field trick solved the problem.

I used two profiles with two news styles (news.txt and sticky.txt). I editted the profile that used the news style with the file sticky.txt and it worked with the filter by field settings.

Thanks again!
Xevor
 
Posts: 9
Joined: Fri Aug 12, 2005 6:55 pm


Return to Customization

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron