Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Paging style / transformation change View modes: 
User avatar
Member
Member
beau.cowan-rrpartners - 9/18/2013 5:00:36 PM
   
Paging style / transformation change
I want to be able to change the repeater for the Latest Blogs widget. We have a custom style that the client wants implemented, which calls for changing < to Previous and > to Next, as well as more graphic arrows instead of |< and |>

I'm having a hard time finding where these transformations are, and could use a little help. I don't want to rely on just styling what's there with CSS, especially when I need to change some of the content that's in there.

User avatar
Member
Member
kentico_sandroj - 9/18/2013 5:46:39 PM
   
RE:Paging style / transformation change
Hello,

This is not possible to specify. I would suggest using Universal pager web part as a external pager instead of the default repeater’s pager that is built into the repeater.

The Universal pager has many properties that allows you to style the pager according to your needs (Pages transformation, Current page transformation, Page separator transformation, First page transformation etc.).

It should be sufficient to set the Target control name property of the Universal pager to the ID of the repeater that should be paged.

Would that work for you?

Best Regards,
Sandro

User avatar
Member
Member
beau.cowan-rrpartners - 9/18/2013 8:15:40 PM
   
RE:Paging style / transformation change
I'm not having much luck using that webpart, but it did make me think about using a cmsrepeater for the blog posts. I couldn't find much documentation on the general properties and how to utilize some of it's paging, but I've been able to adjust it somewhat.

If I'm understanding you original post correctly, I should be able to just throw the ID of the repeater I put into my document template and it should work, correct? Cause I've tried doing that to no avail.

I'm also trying to reference the cmsrepeater in my code behind to filter the results by tags and categories.

User avatar
Member
Member
kentico_sandroj - 9/19/2013 12:49:36 PM
   
RE:Paging style / transformation change
Hello,

Which development model are you using? If its ASPX, you would have to define all of the transformation as they are defined by default when you add the Web part to a Portal Engine page. The default transformations can be found under CMS.PagerTransformations for Site Manager > Development > Document Types. As for the filter, you should be able to filter the repeater using the WHERE condition; what have you tried so far?

User avatar
Member
Member
beau.cowan-rrpartners - 9/19/2013 1:13:47 PM
   
RE:Paging style / transformation change
I'm using the ASPX development model for this project.

I'm trying to put the CMSRepeater into the TemplatePage, which I can get to display. However, when it comes to filtering by the query string, that's where I'm having problems. I'm trying to do it in the code behind, but it's not recognizing the ID. Is this something that can only be done in a web part?

I've started trying to play around with the Universal Viewer webpart as well, and can modify the paging styling through that, but I still run into the filtering issue, for both tagid and categoryid in the query string.

User avatar
Member
Member
kentico_sandroj - 9/19/2013 1:53:51 PM
   
RE:Paging style / transformation change
Hello,

Yes, this should be possible in the Web part, you could use the following for the querystring values:
CMS.GlobalHelper.URLHelper.GetQueryValue(CMS.GlobalHelper.URLHelper.RawUrl, "query")
If this doesn't help, would it be possible to provide the full code that you are using so I can check if something is missing?

User avatar
Member
Member
beau.cowan-rrpartners - 9/19/2013 2:13:29 PM
   
RE:Paging style / transformation change
the thing is that we are planning on transferring this site into a SAAS environment, so I don't think that I'll be able to access the webpart there. Unless I'm missing something.

We want to try and use as much of the "out of the box" controls as possible, which is surprising to me that there is no filter option for tagid or categoryid already built into the webpart.

Anyway, if we cannot modify the Universal viewer webpart in the SAAS, then should I just copy/past all of the fields and recreate it as my own webpart so that I can have this functionality?

User avatar
Member
Member
kentico_sandroj - 9/19/2013 2:34:08 PM
   
RE:Paging style / transformation change
The universal viewer allows you to specify a WHERE condition (No categories or tags specifically) but that should work with the GetQueryValue method.

If that wouldn't work for you, you do have the option to develop a custom Web part or modify an existing (clone of a) Web part.

Would you like me to test the available options? If so, please give me a simplified scenario and I will configure an example.

User avatar
Member
Member
beau.cowan-rrpartners - 9/19/2013 5:01:46 PM
   
RE:Paging style / transformation change
I decided to go with cloning the webpart and modifying that. It seems to be the best option at this time.

I'm working on trying to get the querystring parameters for by "tagid" and "categoryid" and adjust the WhereCondition to what it needs to be for either selection.

I'm just having a difficult time figuring out how to filter the blog posts for the following conditions:

domain.com/blog/?tagid=5
domain.com/blog/?categoryid=15
domain.com/blog/?categoryid=15&tagid=5

Is there a specific way that I need to form the SQL for these conditions?

User avatar
Member
Member
kentico_sandroj - 9/23/2013 12:19:09 PM
   
RE:Paging style / transformation change
Hello,

Thank you for the additional clarification. I added the UniView to an ASPX page and used the following code to filter by category and tags:
        string Param1 = QueryHelper.GetString("tagz", "");
string Param2 = QueryHelper.GetString("catz", "");
string where = "DocumentTags LIKE '%" + Param1 + "%' OR DocumentID IN (SELECT DocumentID FROM CMS_DocumentCategory WHERE CategoryID='" + Param2 + "')";
TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
DataSet documents = tree.SelectNodes(CMSContext.CurrentSiteName, "/%", "en-us", true, "CMS.BlogPost", where, "");

if (!DataHelper.DataSourceIsEmpty(documents))
{
this.UniView1.DataSource = documents;
this.UniView1.DataBind();
}

With this approach you wouldn't have to modify the Web part, just configure it for the individual page. Would this approach work for you? Please let me know if you have any questions. You can test this by manually adding the ?catz=X&tagz=Y querystrings to the page.