Why paginate widget is not including my query string parameters? - pagination

I have news listing including pagination with news tags. When i am paginate through news(or any custom extension) it bypass parameter.
On page /tag the pagination links should look like this: /tag/seite/2 but i just get /seite/2 without any parameters.
Any ideas what i am doing wrong/how to solve my issue?

I tried it by adding addQueryStringMethod="GET" as parameter in <f:widget.link> and it works!

Related

Returning 2 callbacks to scrapy URLs with no HREF tags

I'm currently using a CrawlSpider to look for any links and therefore follow them.
In order to crawl urls without HREF tags (plain text) i'm extracting them and then using the following snippet to add them back into the parse method.
return scrapy.Request(f'http://{url}')
The problem with this method is that the base URL doesn't get called into my other parser method. e.g. example.com doesn't but example.com/example does. I've tried adding a callback into the code (callback=self.url_parser) but then the default parse method isn't called and therefore doesn't crawl and follow links.
Is there a way to pass these href-less links into the default parse method (in order to follow links) but also have them parsed by my parser method?
Thanks!
I ended up changing my callback on the rules to parse_start_url and everything worked perfectly

What's the recommended approach for hierarchical URLs in Orchard?

I'd like to have a hierarchical URL structure in my site. Something on these lines:
tutorials
javascript
jquery
There should be a page at each level (tutorials, tutorials/javascript and tutorials/javascript/jquery). Obviously, using Taxonomies would help me organize my content in this manner, but how do I get Autoroute URLs generated for this scenario?
Bertrand Le Roy made a comment on this SO answer about using taxonomy terms as pages but it still doesn't seem to create the right URL structure for me. Am I missing something? Is there something specific I need to configure or enable to make this happen?
Are there any other approaches I can look at?
I was thinking of specifying the default route as something like {Content.Fields.Page.TaxonomyName}. It appears that this isn't really possible right now according to this bug report.
Here's an approach that seems to work without having to use taxonomies:
I added a Content Picker field called ParentPage to the Page content type and updated the Page's Autoroute default to
{Content.Fields.Page.ParentPage.Content.Path}/{Content.Slug}
Now in each page I get to pick what the parent page is and the URL is constructed how I expect it. From what I remember of working with WordPress, I think this is pretty close to how it allows you to do this parent page thing, too.

Use query strings with Pagination Class in Codeigniter

Is it possible to append query strings to the links created by the pagination class?
Currently if you are on this page:
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&price_high=300
the links are incorrectly generated as
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes&per_page=20
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes&per_page=40
etc.
where it should be:
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&price_high=300&per_page=20
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&price_high=300&per_page=40
etc.
I have tried to pass
$config['base_url'] = current_url();
to the Pagination class, but that doesn't work.
Update: I gave up on this and following a post on CI forums, I have build an intermediate controller that takes the $_POST array and builds a query string
$query = 'type:apartment,house&price_low:15000&price_high:60000';
Then redirects to the Browse controller
http://127.0.0.1/~panayi/xryses/Nicosia/browse/type:apartment,house&price_low:15000&price_high:60000
and paginated views:
http://127.0.0.1/~panayi/xryses/Nicosia/browse/type:apartment,house&price_low:15000&price_high:60000/20
http://127.0.0.1/~panayi/xryses/Nicosia/browse/type:apartment,house&price_low:15000&price_high:60000/40
etc.
You will need to customize the Pagination library of Codeigniter to do this.

Getting URL for item using GetSiteData in Sharepoint

I'm using web.Site.MakeFullUrl((new SPFieldLookupValue(row["FileRef"] as string).LookupValue)) to get the URL to results in a GetSiteData query.
For some items this works fine, but for others I get results like
http://server/Lists/My%20Message%20Board/Test/9_.000 - which always 404s. The urls always end in n_.0000.
Does anybody know why this is happening and how to get the correct URL?
The items generating the weird url are not items in a Document Library that have a file associated with the actual SPListItem. The "normal" urls are urls to files in a doc lib, the weird ones are urls to items in a regular list. Just check for the type of item in the webpart / control / xsl to render the results.
If it is an item from a regular list (with the weird url), just replace it and make the url look like so:
http://server/Lists/My%20Message%20Board/Test/9_.000 should be:
http://server/Lists/My%20Message%20Board/Test/AllItems.aspx?ID=ITEMID
The advice above, by Colin, seems sound except for the fact that the 'good' url should reference Dispform.aspx. For example,
The URL,
http://server/Lists/My%20List/2%5F.000
Should be formatted like this:
http://server/Lists/My%20List/Dispform.aspx?ID=2

Sharepoint Blog: enable/disable comments regarding field value of Posts

I need to enable/disable post comments regarding the value of a new field in Post list. I don't see how to do this... Any ideas?
Why is there an error when converts to XSLT? Is possible to get the querystring to do this?
I don't think you'll be able to get that level of control with the standard blog component. Should be reasonably easy to implement using CKSEBE though.
Easiest method I can think of within the standard blog is to use jQuery to hide the comment form - that way you only need to get the value of the field appearing somewhere on the page.

Resources