Weblog comment error - sitecore

I am using Weblog for blog functionality. Now I am facing one problem. I have created one Entry with name like 'sitecore-mvc', now when I am going to submit a comments it is giving me error 'End of string expected at position 39' if I changed Entry name like 'sitecoremvc' it works fine. There is some problem when I use '-' in Entry name. Any how I want to use '-' in url. Please give me solution.

If you look at the issues in GitHub for Weblog this is a known issue.
See this link for a solution:
https://github.com/WeTeam/WeBlog/issues/52
You should be able to swap out the DuplicateSubmissionGuard pipeline processor to a custom implementation that escapes hyphen characters in the path.

Related

Spaces in wikimedia templates

I'm working on a MediaWiki-generated Wiki, and want to build a template that would link me to a French Wikipedia article. I have this :
[http://fr.wikipedia.org/wiki/{{{1|}}} {{#if:{{{2|}}}|{{{2|}}}|{{{1|}}}}}]
Logic being :
{{Wpfr|article name|alternate name (if needed)}}
Thing is, if the article name has spaces in it, it breaks, keeping the first word as {{{1}}} and putting the rest in {{{2}}}.
I'd like to find a way to be able to use spaces in {{{1}}} without breaking the links. That way :
{{Wpfr|Greg Weisman}}
would automatically link to the article on Greg Weisman and display "Greg Weisman".
I've tried using :
[http://fr.wikipedia.org/wiki/{{{art|}}} {{#if:{{{2|}}}|{{{2|}}}|{{{art|}}}}}]
{{Wpfr|art=article name}}
(even replacing the 2s by 1s) to no avail.
The Wiki admin part hasn't been updated in a while so the Interwiki table can't be updated and I can't use the "replace" function either.
I'm new to Wikicoding, so I'm sorry if the answer is very simple.
Thanks !
Edit : the MediaWiki version is 1.13.5
Mediawiki has a magic word for handeling encoding of url:
{{urlencode:data|style}}
{{urlencode:Greg Weisman|PATH}} will return:
Greg%20Weisman
Change your template with:
[http://fr.wikipedia.org/wiki/{{urlencode:{{{1|}}}|PATH}} {{#if:{{{2|}}}|{{{2|}}}|{{{1|}}}}}]

content empty when using scrapy

Thanks for everyone in advance.
I encountered a problem when using Scrapy on Python 2.7.
The webpage I tried to crawl is a discussion board for Chinese stock market.
When I tried to get the first number "42177" just under the banner of this page (the number you see on that webpage may not be the number you see in the picture shown here, because it represents the number of times this article has been read and is updated realtime...), I always get an empty content. I am aware that this might be the dynamic content issue, but yet don't have a clue how to crawl it properly.
The code I used is:
item["read"] = info.xpath("div[#id='zwmbti']/div[#id='zwmbtilr']/span[#class='tc1']/text()").extract()
I think the xpath is set correctly and I have checked the return value of this response and it indeed told me that there is nothing under this directory. Results shown here:'read': [u'<div id="zwmbtilr"></div>']
If it has something, there should be something between <div id="zwmbtilr"> and </div>.
Really appreciated if you guys share any thoughts on this!
I just opened your link in Firefox with NoScript enabled. There nothing inside the <div #id='zwmbtilr'></div>. If I enable the javascripts, I can see the content you want. So, as you already new, it is a dynamic content issue.
Your first option is try to identify the request generated by javascript. If you can do that, you can send the same request from scrapy. If you can't do it, the next option is usually to use some package with javascript/browser emulation or someting like that. Something like ScrapyJS or Scrapy + Selenium.

Sitecore 7.2 Media Library images not working with underscore in the name

I just upgraded a client's test installation of Sitecore to 7.2 (SP1) and now, any image that has an underscore in its name is throwing a 404 error when being referenced by a page. This was actually a series of upgrades from 6.4 so it's quite possible that a config setting somewhere got missed along the way, but I don't see anything standing out at me that would cause this problem.
If I change the image name to not have an underscore, it works fine, and it also works fine if I set "Media.UseItemPaths" to false, but they would prefer it if their image URL's had the file name displayed.
Can anyone help identify what may have gone wrong?
Due to a change in Sitecore 7.1, any replacements specified in encodeNameReplacements are now also applied to media items as well as regular items in the content tree.
One option is to remove the replaceWith="_" declaration, but the likely reason this was added was to possibly replace spaces in your URLs so they do not display with %20. Removing this declaration will mean they return!
You can instead apply the fix specified in this Sitecore Knowledgebase article: Sitecore is unable to open media items when using encodeNameReplacements

Joomla Load Module in Featured Article

What I use:
- Joomla 2.5
- gantry framework
Need:
I must place in my homepage a slideshow module inside the mainbody as a featured article.
What I did:
Installed a slideshow module and placed temporary inside gantry's maintop-a position to see if it worked (it did), then moved in a non-previously-exsisting 'slideshow' position.
Created a new article, with this content: {loadposition slideshow} and set it to featured state.
Result:
the article was published correctly but the introtext char limit trimmed the actual module code to 100 chars making it useless.
What I already tried to fix the issue:
Modified my slideshow article from database adding the loadmodule code in the fulltext field (which was originally empty),
then modified components/com_content/view/featured/tmpl/default_item.php replacing echo $this->item->introtext; with an if to identify my slideshow article id then query the database to find the fulltext field and echo it. this thingy works but the loadmodule function isn't, so it's displayed as simple HTML. I deduce that introtext is treated differently than fulltext since what's inside the brackets is interpreted as code only when echoed as introtext, and I miss that layer.
Modified modules/mod_articles_category/helper.php to break the 100 introtext_limit, sadly finding that's not called for my featured articles (added dump($item, 'some name') which returns only the articles that are inside my news sidebar, even if all my featured articles including slideshow are categorized)
tried a million different combinations of the above (i.e.:{loadmodule slideshow}{module [myslideshow_article_id]} <- a module loader plugin i tried, ...) which are too long to put here.
Searched the whole project folder for files containing 'introtext' inside their code, finding alot, but nothing that actually trims it (except helper.php of course)
Searched the Joomla API
Googled for everything that came into my mind finding no working solutions.
Came Here :)
Thanks
If you want to show a module inside an artice, you can use an component to show them there.
In my experience, this works on normal and featured articles, so this might work for you:
http://www.nonumber.nl/extensions/modulesanywhere
I hope this was helpfull, since this is my first answer here.
Kind Regards,
McBurgerKong

Open Cart decimal_point error on all price

I recent installed an OpenCart on server. I am facing an error (decimal_point) on all prices. Like up where cart shows (0 item(s) - $0decimal_point00) and bottom where product price is shown. I am new to OpenCart.
How can I solve this problem?
today I've solved this problem.
the
$_['decimal_point']= '.';
is displayed in
catalog/language/language_name/language_name.php
and
admin/language/language_name/language_name.php
but you should copy this line to
catalog/language/language_name/product/product.php
and everything will be ok
PS: language_name should be renamed to a correct name because at first I mistaken with french language pack and rename the folder to french but after I change it to frenc my store worked properly
Good Luck
Add the line
$_['decimal_point']= '.';
in catalog/language/language_name/common/cart.php
I solved this by updating language pack to latest version. It solve it completely.
So the reason is somewhere in language pack.
I went into admin --> Home/Languages and changed the directory value to match what was on the server in a case sensitive way.
On Windows it was working since it is case insensitive and Italian was with capital letter but when uploaded on Linux the case sensitiveness kicked in and this was shoung also strange timestamps.
I had this same problem and I solved it in a very simple and silly way, after trying everything I found on each page about it.
I was showing "decimal_point" in the prices, because the language I configured it as es-cr.php, but the file in Spanish is called es-es.php, by not agreeing, I gave that error, so I just changed the name to es-cr.php and everything works correctly.
I know this is an old thread, but if someone comes across it, the solution is to make sure you have the file [language_name]-[country].php in the following folders:
If the issue is in the admin side, the folder is: admin/language/[language_name]-[language_name] // ex.: for english, the folder is admin/language/en-gb, the filename is en-gb.php.
If the issue is in the store front, the folder is: catalog/language/[language_name]-[language_name] // ex.: for english, the folder is catalog/language/en-gb, the filename is en-gb.php.