Hi All,
I am implementing template https://en.wikipedia.org/wiki/Template:Cite_web in VE and after using the template code[1], I get results shown below
{{Cite web|url= https://www.w3schools.com/jsref/jsref_replace.asp%7Ctitle=W3Schools%7Clast=W... }}
what I desire to get is
<ref>{{Cite web|url= https://www.w3schools.com/jsref/jsref_replace.asp%7Ctitle=W3Schools%7Clast=W... }</ref>
So I guess I am missing something. Please I need help with this.
Thanks Eugene -- [1] https://etherpad.wikimedia.org/p/Template_cite_with_VE
Hi,
On Tue, Dec 31, 2019 at 12:42 PM Egbe Eugene agboreugene@gmail.com wrote:
Hi All,
I am implementing template https://en.wikipedia.org/wiki/Template:Cite_web in VE and after using the template code[1], I get results shown below
Sorry, I may not be understanding what you are trying to accomplish, I am guessing reimplementing Cite_web functionality on your own local mediawiki installation? I don't know much about visual editor or references-related code, someone else may be able to help you here better, but I know that is implemented on enwiki: https://phab.wmfusercontent.org/file/data/wz3njgh6k6iwrugvap6f/PHID-FILE-n6e... https://en.wikipedia.org/w/index.php?title=User:JCrespo_(WMF)/sandbox&ty...
So my only suggestion is to look at how enwiki has it configured and try to adapt it to your needs.
Another suggestion is to use Phaste: https://phabricator.wikimedia.org/paste/edit/form/14/ for code snippets, as it will prevent vandals from editing it + allow comments.
Sorry I cannot be of more help,
Hi Eugene, Assuming it is local installation or wiki other than English wikipedia where citations aren't yet configurated you can follow
E.g copy https://en.wikipedia.org/wiki/MediaWiki:Citoid-template-type-map.json and https://en.wikipedia.org/wiki/MediaWiki:Visualeditor-cite-tool-definition.js...
If you are doing it in one of Wikimedia projects and not local installation, it will be great to update : https://phabricator.wikimedia.org/T127354
On Tue, Dec 31, 2019 at 4:13 PM Jaime Crespo jcrespo@wikimedia.org wrote:
Hi,
On Tue, Dec 31, 2019 at 12:42 PM Egbe Eugene agboreugene@gmail.com wrote:
Hi All,
I am implementing template
https://en.wikipedia.org/wiki/Template:Cite_web
in VE and after using the template code[1], I get results shown below
Sorry, I may not be understanding what you are trying to accomplish, I am guessing reimplementing Cite_web functionality on your own local mediawiki installation? I don't know much about visual editor or references-related code, someone else may be able to help you here better, but I know that is implemented on enwiki:
https://phab.wmfusercontent.org/file/data/wz3njgh6k6iwrugvap6f/PHID-FILE-n6e...
https://en.wikipedia.org/w/index.php?title=User:JCrespo_(WMF)/sandbox&ty...
So my only suggestion is to look at how enwiki has it configured and try to adapt it to your needs.
Another suggestion is to use Phaste: https://phabricator.wikimedia.org/paste/edit/form/14/ for code snippets, as it will prevent vandals from editing it + allow comments.
Sorry I cannot be of more help,
Jaime Crespo http://wikimedia.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
{{Cite web}} and similar templates can also be used outside of a <ref> tag, e.g. on a page like this: https://en.wikipedia.org/wiki/Review_aggregator#Bibliography (not the greatest example, but the best I could find quickly).
If you want it inside of a footnote, it's a bit complicated in visual mode, since the footnotes can be reused multiple times. The way it works is that there is a separate place in the document where the contents of every reference are placed (the "internal list"), and the location of the <ref> contains only a small node that links to the internal list.
Manually constructing the data so that both these things refer to each other would be a pain, but there is a helper class that makes it more convenient, ve.dm.MWReferenceModel.
You'd use it like this:
https://phabricator.wikimedia.org/P10018
I adapted that example from the code in ve.ui.MWCitationDialog.prototype.getActionProcess, which is how VE itself inserts new references.
Hope that helps (and doesn't look too awful).
Thanks for the help Bartosz. However, I have a large data definition of both texts and citations so I was wondering if its possible to insert the texts and citations all in one go when writing to the VE surface. In such cases, we expect the VE surface to identify, the citation where we are including the 'mwTransclusionInline' template in our data. Please is this possible?
Thanks
On Wed, Jan 1, 2020 at 4:56 AM Bartosz Dziewoński matma.rex@gmail.com wrote:
{{Cite web}} and similar templates can also be used outside of a <ref> tag, e.g. on a page like this: https://en.wikipedia.org/wiki/Review_aggregator#Bibliography (not the greatest example, but the best I could find quickly).
If you want it inside of a footnote, it's a bit complicated in visual mode, since the footnotes can be reused multiple times. The way it works is that there is a separate place in the document where the contents of every reference are placed (the "internal list"), and the location of the <ref> contains only a small node that links to the internal list.
Manually constructing the data so that both these things refer to each other would be a pain, but there is a helper class that makes it more convenient, ve.dm.MWReferenceModel.
You'd use it like this:
https://phabricator.wikimedia.org/P10018
I adapted that example from the code in ve.ui.MWCitationDialog.prototype.getActionProcess, which is how VE itself inserts new references.
Hope that helps (and doesn't look too awful).
-- Bartosz Dziewoński
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Thanks very much for the suggestions.
It looks like I did not pose the question very clearly.
We desire that the surface displays something like "Hello[1] world[2]" on the VE surface and then have the footer note pick up these [1] and [2] automatically and display them for us at the bottom of the page as in the case where <ref>{{cite|a}}</ref> gets picked up in wikicode and rendered.
Is this possible?
I am not really sure what you mean…
Here's a complete example that inserts, basically, "Hello[1] world[2]" (text with two different references):
https://phabricator.wikimedia.org/P10038
Does that help?
Thanks very much Bartosz, I tried it on my VE sandbox page on en.Wikipedia and it works really cool. However, I get the following error on my local MW install
*jQuery.Deferred exception: ve.dm.MWReferenceModel is not a constructor TypeError: ve.dm.MWReferenceModel is not a constructor*
I should be lacking a module or something. Please can you help with this?
Thanks once more,
Sounds like you don’t have Cite installed?
On Monday, January 6, 2020, Egbe Eugene agboreugene@gmail.com wrote:
Thanks very much Bartosz, I tried it on my VE sandbox page on en.Wikipedia and it works really cool. However, I get the following error on my local MW install
*jQuery.Deferred exception: ve.dm.MWReferenceModel is not a constructor TypeError: ve.dm.MWReferenceModel is not a constructor*
I should be lacking a module or something. Please can you help with this?
Thanks once more,
Eugene
On Sat, Jan 4, 2020 at 10:10 AM Bartosz Dziewoński matma.rex@gmail.com wrote:
I am not really sure what you mean…
Here's a complete example that inserts, basically, "Hello[1] world[2]" (text with two different references):
https://phabricator.wikimedia.org/P10038
Does that help?
-- Bartosz Dziewoński
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Thanks very much Bartosz, it works just fine with Cite. Just a follow up question. *Is Cite responsible for rendering <references />* *?*
On Mon, Jan 6, 2020 at 3:03 PM Bartosz Dziewoński matma.rex@gmail.com wrote:
Sounds like you don’t have Cite installed?
On Monday, January 6, 2020, Egbe Eugene agboreugene@gmail.com wrote:
Thanks very much Bartosz, I tried it on my VE sandbox page on
en.Wikipedia
and it works really cool. However, I get the following error on my local
MW
install
*jQuery.Deferred exception: ve.dm.MWReferenceModel is not a constructor TypeError: ve.dm.MWReferenceModel is not a constructor*
I should be lacking a module or something. Please can you help with this?
Thanks once more,
Eugene
On Sat, Jan 4, 2020 at 10:10 AM Bartosz Dziewoński matma.rex@gmail.com wrote:
I am not really sure what you mean…
Here's a complete example that inserts, basically, "Hello[1] world[2]" (text with two different references):
https://phabricator.wikimedia.org/P10038
Does that help?
-- Bartosz Dziewoński
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Matma Rex _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org