Microsoft Content Management Server - Order postings on placeHolder content

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > April 2005 > Order postings on placeHolder content





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Order postings on placeHolder content
lebastos

2005-04-25, 8:47 pm

Hi everybody,

How knows how I could get my postings sorted on the ascending value of a
placeHolder content which contains values (1,2,3....) ? If someone has a very
easy way to do such a thing using the cms objects it would be nice !

I tried to use an arrayList which contains my postings but I don't know how
I can sort it on the placeHolder which is my order key. The sorting of
arrayLists seem to be very difficult when thee are composed of many columns
and I didn't find on the Net any interesting example.

Many thanks.
Stefan [MSFT]

2005-04-25, 8:47 pm

Hi Lebastos,

you would need to implement an IComparer to do the comparison.
Actually this is more an ASP.NET question than a MCMS question:

class CMySort:IComparer
{
private int intCompType;

public CMySort(int sortOrder)
{
intCompType = sortOrder;
}

public int Compare(object x,object y)
{
Posting p1 = (Posting)x;
Posting p2 = (Posting)y;

string PhContent1 = ((HtmlPlaceholder)(p1.Placeholders["phname"])).Text;
string PhContent2 = ((HtmlPlaceholder)(p2.Placeholders["phname"])).Text;

return (PHContent1.CompareTo(PHContent2));
}
}


Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"lebastos" <mbechaa@hotmail.com> wrote in message
news:40645930-3B92-4BD4-8BC5-69D85CF86B1F@microsoft.com...
> Hi everybody,
>
> How knows how I could get my postings sorted on the ascending value of a
> placeHolder content which contains values (1,2,3....) ? If someone has a

very
> easy way to do such a thing using the cms objects it would be nice !
>
> I tried to use an arrayList which contains my postings but I don't know

how
> I can sort it on the placeHolder which is my order key. The sorting of
> arrayLists seem to be very difficult when thee are composed of many

columns
> and I didn't find on the Net any interesting example.
>
> Many thanks.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com