I'm a web developer who works with HTML, PHP, CSS, ExpressionEngine, Javascript, jQuery, MySQL, SEO and UI/UX design. Always looking to learn new web related stuff, and a bit of a PC gamer. You can also find me on Twitter and LinkedIn.

Posts Tagged: snippet

Text

Just a quick one.

I’ve recently had the need to use a submit button in a web form, with no CSS styling and without using an image (the client wanted it to look like a standard form button), which had to have the value text of the button on 2 sperate lines.

Using the <br /> tag didn’t work, and neither did the use of ‘/n’. So after a bit of digging I found an ascii code which worked: &#10;

Here’s an example of the code in use:

<input type="submit" value="Submit&#10;Query" />

Text

As is usually the case with forums attached to a main site, the forum is kept seperate in either a folder (yourdomain.com/forums) or a sub-domain (forums.yourdomain.com).

With the Expression Engine Discussion Forum Module, it’s easy to display your most recent topics in one of your main website templates. This is a snippet of the code I’ve used to display and link through to the top 5 most recent forum threads:

<ul>
{exp:forum:topic_titles orderby="post_date" sort="desc" limit="5"}
<li>
<h3><a href="{auto_thread_path}">{title}</a></h3>
<p>{topic_date format="%d/%m/%Y %h:%i %a"}</p>
</li>
{/exp:forum:topic_titles}
</ul>

You can find a list of the parameters and variables you can use with the {exp:forum:topic_titles} tag in the ExpressionEngine User Guide > Displaying Recent Forum Topics.

Text

This may only be useful in particular circumstances (most obviously when using ExpressionEngine), but nonetheless it was useful to me, so here it is:

I have a number of Weblogs set up for managing the content on a website. The majority of these have been assigned to a ‘Static Content’ field group, and it’s these weblogs that I intend to use as menu links, with the individual posts in the section as sub-menu links.

Other weblogs have other specific Field Groups for their specific content, i.e. File Downloads and News Articles.

So to do this, I used a query to list only the Weblogs that use the ‘Static Content’ Field Group, and here it is:

SELECT
exp_weblogs.blog_name,
exp_weblogs.blog_title
FROM
exp_field_groups
Inner Join exp_weblogs ON exp_weblogs.field_group = exp_field_groups.group_id
WHERE
exp_field_groups.group_name = 'Static Content'

Short and sweet, and I hope it’s useful to somebody.