I am using indexes to order Patterns. As recommended I am putting some spaces between the pattern indexes in case i would like to reorder some later.
I am naming the files like shown in https://patternlab.io/docs/reorganizing-patterns/.
It does work. As you can see in the next screenshot, the index is also shown in the rendered page. Is there a way to hide it or am I doing something wrong? Is there maybe a different approach using Handlebars (.hbs) files?
The easiest would be to migrate to the newest patternlab version and use the „order“ property introduced to get set via .md files, compare to the new content on the page you mentioned in your post.
Related
My question is simple, do I need to rename vector.js file when I create a skin based on Vector? Let me explain more on how I created my custom skin...
I have created a custom skin for my Mediawiki and its based on Vector. My skin works almost exactly like Vector but with css tweaks and with changes to the html template elements inside the skin template which is basically moving around the elements and displaying a bit different that the way it is done in Vector. I read the following tutorials when creating my template:
https://www.mediawiki.org/wiki/Manual:Skinning/Tutorial
http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/
These are the things I did when creating the custom skin:
I copied and pasted the Vector folder and then renamed it to 'myskin'.
I then created the 3 files, skins/myskin/myskin.php, skins/myskin/MySkin.skin.php and skins/myskin/MySkin.i18n.php like its mentioned in the tutorial link above.
I then renamed the key, identifier and name of my skin from vector to MySkin or myskin like its mentioned here:
"When building a skin you'll be working with your skin name in three
forms, a lower-cased key, a camel cased identifier, and a localized
skin name. For our skin the key would typically be 'myskin', the
identifier 'MySkin', and the localized name 'My Skin'.
I edited the screen.css and tweaked it to the style I want.
I then edited the skin template. Here instead of using "class SkinMySkin extends SkinVector", I copied the "class MySkinTemplate extends BaseTemplate" section from Vector and re-arranged the templates and tweaked it to create my skin.
After doing all of the above, everything works. However, I noticed that when I copied all the files from Vector to MySkin, there is this "vector.js" file in it too. I dont know if I need to rename this js file to myskin.js or do I leave it like this. Currently I did not rename this javascript file and everything seems to be working fine anyways. So I am not sure what this file does. I read the tutorials and also searched MediaWiki and it doesnt mention anywhere if I need to rename this file to myskin if I am creating a skin based on Vector. I also dont see a link or reference to this file inside my skins/myskin/myskin.php, skins/myskin/MySkin.skin.php and skins/myskin/MySkin.i18n.php files. Can someone please clarify this for me?
I have also created a custom skin with the manual like the OP. I didn't rename vector.js and everything seem to work fine for me.
You could simply rename or move vector.js and check if you notice any missing functions or weird behaviour in either the following functions
Collapsible tabs
Focus search input at the very end
animate drop down menu in and out
or
Always collapse if the "More" button is already shown
Since this is more or less all the .js seems to do + providing some fallbacks.
What would be the proper procedure for accessing the current page html data and picking up all of a certain tag and throwing them into the sidebar as links?
I'm not sure your proficiency with php, but I'll give you and overview of what you'd probably want to do.
First, you need the HTML. I'm assuming you're running this on a page (in a page.php file or single.php file, or similar), this means that you have access to the global variable $post, which contains the html of the page in it. To access it you can use the helper function get_the_content(), this returns the html being displayed.
Next you need to parse through this to get the h2 tags. A simple regex can handle this, something like <h2[^>]*>(.*)</h2>. It's important to remember that this regex is very picky, so format your html correctly, no multiline h2s.
So now you have the html, and have parsed it with a regex to get the h2s. Now you need to generate the list from the results, and prepend it to the top of the content of the page. There are a ton of ways to do this, the easiest being just running the code in the right spot in the template file.
Of course there are probably better ways of doing this, I'd recommend you look at say a FAQ plugin (if that's what this is for), or do the lists manually (as this system can be broken), or possibly use a custom post type; but for your question, that's how I'd do it.
I am generating some PDF's and I would like to disable the header on the frontpage. I know there are built-in templates in rst2pdf and one template is called coverPage but I don't seem to be able to get it to work.
The manual is saying you should use a
..raw:: pdf
PageBreak coverPage
statement but that will insert a empty before the coverpage, so how can I have a coverpage without a header and without using the oddeven directive (I want to use the same header on all remaining pages).
Thanks for your suggestions!
That's how you change the stylesheet after the cover page. You'll need to create a custom stylesheet that specifies what is the format of the first page and then change the style for the rest of document. Have a look at chapter 15 of the manual.
Note: current accepted answer contains broken link (linked website has gone).
The correct answer is simple:
1) In you style-file define:
pageSetup:
firstTemplate: coverPage
2) Then in your template, when you want to start using header/footer add:
..raw:: pdf
PageBreak cutePage
Make sure cutePage has set header/footer to true.
With the FCKEditor, you can specifiy paths where the editor must be included. Eg.
node/add/email
Which works great, until you need to go back and EDIT that node. Which means you end at a path like so:
node/284/edit
Now, the fck editor no longer works, because the path isn't valid.
Is there any way that one can get the FCKEditor to work for both the normal path and the edit path of ONE SPECIFIC CONTENT TYPE?
I'm not sure if you can do this with stock the FCKEditor module. However, you can do it by using the WYSIWYG API module, which allows you to specify WYWIWYG editors on a per-input-filter basis, and Better Formats, which allows you to set input filter formats on a per-node-type basis.
I have a legacy application that I needed to implement a configuration page for to change text colors, fonts, etc.
This applications output is also replicated with a PHP web application, where the fonts, colors, etc. are configured in a style sheet.
I've not worked with CSS previously.
Is there a programatic way to modify the CSS and save it without resorting to string parsing or regex?
The application is VB6, but I could write a .net tool that would do the css manipulation if that was the only way.
You don't need to edit the existing one. You could have a new one that overrides the other -- you include this one after the other in your HTML. That's what the "Cascading" means.
It looks like someone's already done a VB.NET CSS parser which is F/OSS, so you could probably adapt it to your needs if you're comfortable with the license.
http://vbcssparser.sourceforge.net/
One hack is to create a PHP script that all output is passed through, which then replaces certain parts of CSS with configurable alternatives. If you use .htaccess you can make all output go through the script.
the best way i can think of solving this problem is creating an application that will get some values ( through the URL query ) and generate the appropriate css output based on a css templates
Check this out, it uses ASP.NET and C#.
In my work with the IE control (shadocvw.dll), it has an interesting ability to let you easily manage the CSS of a page and show the effects of modified CSS on a page in realtime. I've never dealt with the details of such implementations myself, but I recommend that as a possible solution worth looking at. Seeing as pretty much everyone is on IE 6 or later nowadays, you can skip the explanations about handling those who only have IE 5,4,3 or 2 installed.
Maybe the problem's solution, which is most simple for the programmer and a user is to edit css via html form, maybe. I suppose, to create css-file, which would be "default" or "standart" for this application, and just to read it, for example, by perl script, edit in html and to write it down. Here is just the simple example.
In css-file we have string like:
border-color: #008a77;
we have to to read this string, split it up, and send to a file, which will write it down. Get something like this in Perl:
tr/ / /s;
($vari, $value) = split(/:/, _$);
# # While you read file, you can just at the time to put this into html form
echo($vari.":<input type = text name = ".$vari." value = ".$value.">");
And here it is, you've got just simple html-form-data, you just shoul overwrite your css-file with new data like this:
...
print $vari[i].": ".$value.";\n";
...
and voila - you've got programmatical way of changing css. Ofcourse, you have to make it more universal, and more close to your particular problem.
Depending on how technically oriented your CSS editors are going to be, you could do it very simply by loading the whole thing up into a TextEdit field to let them edit it - then write it back to the file.
Parsing and creating an interface for all the possibilities of CSS would be an astronomical pain. :-)