Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I just want to make sure about this matter before starting my new project. So what templates system you prefer for codeigniter framework?
Thanks!
I prefer this one: Phil Sturgeon's template library, it's very smarty like and that's good.
link:
code here
link 2
As Devil's Advocate, why don't use directly PHP in your templates? I use it, with the alternative sintaxis and works perfectly:
<? if ( $pepe == 1 ) : ?>
HTML CODE <?=$var1?> more template <?=$var2?>
<? endif; ?>
<? foreach ($key => $value ) : ?>
Key is <?=$key?> and Value is <?=$value?>
<? endforeach; ?>
What are the advantages you're looking for when using a template system? With this, you don't load anything, no more syntax learning, and everything works smooth and fast.
You can try Stencil. All logic for the layouts are done from the controller, but it makes development quick and easy. It's pretty well documented as well. Some of its features are:
Easily set titles
Simple Layouts Page-specific assets (js, meta, and css, perfect for jQuery plugins)
Page-specific meta data Tons of HTML5 helpers
Flexible ways of binding data to views
Slices (also called partials, includes, nested views, elements, etc)
Slice Callbacks (also called view models where you can execute a block of code
every-time a Slice is used)
Github
Docs
Full-disclosure: This is something I built.
Lastly, this question is asked over and over again, and it should probably be flagged for a duplicate question.
I prefer to use this library:
CodeIgniter Template
It is very easy to config and also you can extend it to. I use it a lot, and I like it very much.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I would like to hide certain posts on my tumblr homepage that have the a specific tag (#journal). I've already tried some codes, but it didn't work.
Here is my actual HTML code:
pastebin.com/JT4KtyVz
My tumblr:
http://heynotspecial.tumblr.com/
Do you guys know how to do that?
Sorry, not used to post code here :(
You need to identify a commonality for posts that have the Journal # tag. I suspect there could be a class name applied to posts with this tag.
You can apply this rule in your CSS stylesheet to hide div elements with the infscrjournal classname.
{block:HomePage}
div[class~=infscrjournal] {
display: none;
}
{/block:HomePage}
**** you need to surround the code with the homepage variable to make sure it only appears on the first page and nothing else. Try that
In VM2, I can use the template override default_relatedproducts.php
with the following code:
<?php echo $field->display ?>
That outputs the HTML
<a title="x" href="x">
<img alt="" src="x.jpg">
Product Name
</a>
Where can I change the output of $field->display, as it doesnt appear to be in the templating system?
Has anyone any information on modifying the related products output..
I'm new to this forum, so I'm not sure this answer will be what you're looking for. But, because I see you have had no answers since posting your question in May, I'll give it a shot.
There is a non-commercial extension to Joomla called "K2" which supposedly provides a large number of GUI enhancements and customization capabilities.
In addition, the makers of K2 have also created a COMMERCIAL component called K2mart which, I understand, somehow "bridges" Virtuemart and K2, adding enhanced editing and customization capability to Virtuemart functions.
I have yet to use K2 or K2mart, but from their descriptions, they may be what you're looking for - if you haven't already solved your problem.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Question: Are there any Mvc framework solutions that I can leverage to create a clean and concise approach that represents my user control that I am converting? (There are four major design considerations listed below)
This user control has a lot of explanatory text information within. I really want to avoid writing a helper method that is a mile long containing a ton of standard HTML and text.
This user control contains a Grid. I have written my on Grid control in Mvc but I have not had any experience as of yet with composition of html helpers in a clean fashion.
This control is only presented to the user as a result of uploading a spreadsheet for importing purposes.
The design needs to account for being in a standalone dll that is used in other projects.
I was considering the idea of using a Partial View. This would be preferable since it could make calls to the html helper to render my grid and contain the explanatory text.
However, I couldn't find examples online that really lent themselves to my scenario. So I not confident of the details.
Thanks for input in advance.
Explanatory text can be stored in a view model. It'll be stored in a
single place and it can easily point to a resource file with
localization (if needed)
Re-factoring. I can't get into more details as I haven't seen the code
If you opt-in for a partial view, you can render control with #Html.RenderPartial, #Html.EditorFor, #Html.DisplayFor depending on what kind of control this is. In my project I have controls for storing and displaying search criteria. So I have something on the lines of
#Html.EditorFor(model => model.CategorySearch, "CategorySearch")
I'm not sure about a seperate DLL, but if you have a clear seperation between a view and domain model, then you should be able to get away with copying your view model and view related components (e.g. partial view, editor/display templates etc)
I hope this helps
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have been searching the internet for days now trying to find out how to write my own script, one more complicated than the "Hello World" script.
I understand for the most part how to find specific elements using firebug (I have Firefox). I understand the metadata and how to do all that.
I do not however understand how I am supposed to get whatever I want into the page. Be it links or tabs for Facebook or other sites.
Can anyone help me get a full tutorial/guide that is up to date and easy to understand for total scriptwriting beginners?
From what you have described in the, I suspect that anything that meets your criteria will actually just be a Javascript tutorial with some extra Greasemonkey-specific sections / focus
There's not links to many guides and tutorials (might add them in later) but I really think that what you need is a beginner's guide to Javascript such as sections 1-8 (except 5) of the one provided at the Mozilla Developer Network.
Greasemonkey stuff:
Specifically, the Greasemonkey-related topics that you will need to read up on are related to the DOM, altering styles of DOM nodes, and the Greasemonkey API. All else that you need will be generic Javascript that will be specific to the script you are creating.
DOM Manipulation:
Inserting / editing / deleting "nodes" ( in the HTML code) - for example, <a>nchors, <div>s, <img>s
This is how the extra links and tabs etc are added into the page.
Specifically, look into appendChild(), createNode() and insertNodeBefore().
DOM Traversal
Moving around the DOM (HMTL Document) and selecting where to insert the new nodes / selecting which nodes to editor delete.
Specifically, look into XPATH, getElement(s)By_____, parentNode, querySelectorAll()
Introduction to using XPath in JavaScript - XPath | MDN
Node.parentNode - Web APIs | MDN
CSS Using Javascript
The basics of changing the CSS of a node are to either use .setAttribute() to set the 'style' attribute, or to alter specific CSS properties using nodeReference.style.cssAttribute = 'value'.
Greasemonkey API
Again, this stuff will be specific to what you want to use within the script you create but the basics include GM_getValue(), GM_setValue(), GM_log()
Greasemonkey Manual:API - GreaseSpot Wiki
Look at Greasemonkey Hacks archived, especially the part Avoid Common Pitfalls archived - I'm often returning to the latter.
Edit: the original links are dead, added links to recent archived version in superscript.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
This can be applied to any language/UI project. When the code is automatically generated, is there a need to name all of the UI controls? Presently I only name the ones I am referencing in code (although admittedly sometimes I get lazy and leave them). Or do you stick with the pre-generated names (textbox1, splitContainer1, menuStrip1, etc..)?
If you name them, how do you prevent overlap such as MyDataGridView1, MyDataGridView2, etc..
I only name the ones I reference too - most modern IDEs will easily rename a widget later if I need to reference it in code.
I usually give the names some meaning - accountDataView, currentBalanceDataView - it must relate to a concept like submitButton for the button that submits a form.
I always try to set GenerateMember to false for the controls I don't use in the code, but for the controls I do use in code, I usually choose meaningful names.
For example, if there was a button that submitted something then I would choose submitBtn. If there was a username textbox then I would call it usernameTxt. Etc, etc.
A small list:
Buttons: btn
Textboxes: txt
Labels: lbl
Checkboxes: chk
Radio buttons: rad
List boxes: lst
Dialogs: dlg
...but above all else, just use what makes sense.
I name the controls that I access and have experimented with using the "ux" prefix so that I can find them easily with Intellisense. That way if I can't remember the exact name of a control I know it at lease starts with ux. Also, if I change the control type, the name can stay the same. I came across this a while back, but can't seem to find the article about it now.
uxFirstName