Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Space Kablooey
May 6, 2009


I did bump into normalize but I thought it was some kind of off-brand CSS reset and didn't look deeper into it. :doh:

In the meantime, I copied the values Chrome gave me in the computed tab and it kinda worked. Thanks. :)


Edit: How would I go adding prefixes to everything in the normalize.css file? I'm thinking it would involve compiling the LESS/SASS of it and doing it that way, correct?

Space Kablooey fucked around with this message at 21:27 on Sep 5, 2016

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

HardDisk posted:

I did bump into normalize but I thought it was some kind of off-brand CSS reset and didn't look deeper into it. :doh:

In the meantime, I copied the values Chrome gave me in the computed tab and it kinda worked. Thanks. :)


Edit: How would I go adding prefixes to everything in the normalize.css file? I'm thinking it would involve compiling the LESS/SASS of it and doing it that way, correct?

Not really. You want the rules you make to be specific only to your sidebar and not overlap with the host page, so you need to make your rules "specific". The easiest way of doing this is to give the outer container of your sidebar an ID. Let's say it's "blah" for our example.

Now let's say you need to style list items. If you just do li { color: red} you run the risk of either making all the host pages list items red, or having its CSS override yours. So, you make sure you put your ID in front of all your rules:
code:
#blah li { color: red !important} 
now your rule only applies to list items inside your sidebar.

To apply that to normalize, just get a plain CSS version and edit it to have your ID in front of all its rules. No need for LeSs or SaSS unless you want to.

Lumpy fucked around with this message at 22:50 on Sep 5, 2016

lunar detritus
May 6, 2009


Proper web components with scoped css are coming right? Right? :negative:

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

gmq posted:

Proper web components with scoped css are coming right? Right? :negative:

Eh. The only thing that will save us for a long time is writing properly scoped css, I'm a BEM supremacist. If you're not targeting single levels of classes you're loving things up for the rest of us.

Slimchandi
May 13, 2005
That finger on your temple is the barrel of my raygun
I need some very beginner-level guidance. My previous experience was using HTML to build a simple website over 15 years ago.

I want to build a website using this waveform-playlist (http://naomiaro.github.io/waveform-playlist/) to host some multitracks which the user can mix themselves in the browser. I want to end up with something which looks like the 'stem tracks' example.

Where do I start? What kind of hosting service will let me do this? When the docs tell me to install using npm, that's something I need to do on the server, correct?

If someone could point me towards a basic primer for using javascript apps, that would be very helpful.

fuf
Sep 12, 2004

haha

DarkLotus posted:

You might want to get some help with your server's mail settings, it looks like alot of the messages are unauthenticated and don't have a from address or a sender id.

I do not understand this sender id stuff at all, and I can't find any good guides.

If I'm right then sender id is kinda like an (obsolete?) version of SPF, in that it checks email is coming from the domain it says it's coming from by looking at a DNS record. So if I'm sending through Mailchannels then I should have another txt record like this?

code:
mydomain.com. 21599 IN TXT "v=spf1 a mx include:relay.mailchannels.net  ?all"
mydomain.com. 21599 IN TXT "v=spf2.0/pra include:relay.mailchannels.net ?all"
and I guess the sender id in the email header should be something like "me@mydomain.com"?

But then when I look at my email headers (and MC dashboard), the sender id always has this format:
code:
 my_mailchannels_smtp_username|x-php-originating-script|1.2.3.4:10001:class-phpmailer.php
where 1.2.3.4 is my server IP, 10001 is the userid of Postfix, and class-phpmailer.php is the file Wordpress uses to send email.

Where is all that coming from? Is it just a Postfix config somewhere? If I google "Postfix sender id" I get nothing useful at all, just more stuff about adding TXT records.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
I've been teaching myself web design out of necessity over the past ten years. I hated it in college, but when I got out I realized how dire the world of print design was and kind of lucked into a web design job. Since I taught myself through trial and error, I'm worried some of my practices might be a little behind the times, mostly because I sometimes feel slightly embarrassed when I read this thread and have no clue what you are all talking about. It doesn't happen often, but when it does.... So, where's the best place to catch up and learn about new stuff?

I don't mean I use FONT tags and inline styles and stuff, I love HTML5, it might just be me worrying I'm not "cool" and "with it" anymore.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

BJPaskoff posted:

I've been teaching myself web design out of necessity over the past ten years. I hated it in college, but when I got out I realized how dire the world of print design was and kind of lucked into a web design job. Since I taught myself through trial and error, I'm worried some of my practices might be a little behind the times, mostly because I sometimes feel slightly embarrassed when I read this thread and have no clue what you are all talking about. It doesn't happen often, but when it does.... So, where's the best place to catch up and learn about new stuff?

I don't mean I use FONT tags and inline styles and stuff, I love HTML5, it might just be me worrying I'm not "cool" and "with it" anymore.

Honestly, if you were actually trying to keep on top of web design and development practices you'd be in an endless treadmill of partially learning new poo poo. As I'm self employed I've had the enjoyable position of being able to push my working practices forward with every project I do, but I'm wary not to chase new shiny too much in favour of just polishing processes on top of stable tech. We use Webpack but don't use it to do every little thing for packaging. We've gone pretty hard into React and now we use for near every single scrap of HTML that comes out of our sites (and also have working processes for component development that really line up with this approach). We try to use convention rather than heaps of technology to solve the CSS problem of scope (as I said in previous posts, we just religiously follow BEM with a dash of pragmatism where it makes sense). We use super stable back end tech like Django for delivering websites on quote.

I guess what I'm trying to say is there's a lot to it, and it's hard to say what is REQUIRED reading except if given scope of your own projects. I honestly think the best way to know HOW to catch up if you feel you're behind the times is to have good discussions about workflow and process with colleagues and people in the industry. Find web developer meetups and get in the habit of debriefing your work. Chatting to other people will expose other ways of doing things, and then it'll start to feel obvious where you're lagging.

Don't just follow blog posts telling you what's cool and you should use, cause frankly a large percentage of them are garbage. They demonstrate trivial examples where <thing> is cool, and gloss over drawbacks, tradeoffs, etc of <thing>. HTML5 itself isn't changing THAT fast. Really, it's not. The spec moves slow and all the features that Google make news about on their browser just isn't battle-ready and won't be for a long time. The fundamentals are fairly stable.

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Does anyone know how I can create a new dictionary extension for Firefox similar to Rikaichan's https://addons.mozilla.org/en-US/firefox/addon/rikaichan-jpen/ JPN-ENG dictionary add-on? I don't know where to look to locate the actual thing here so that I can modify it. I want to create a KOR-ENG dictionary extension so that I can use Rikaichan but for Korean.

I think I'm competent enough with JS or whatever language Firefox extensions use here in order to get this done... I just don't know where to look and I was hoping someone in this thread would know what direction I need to go in. You don't have to write an effortpost or whatever for me, just an informative link or a file path to where I can find the extension's source code in my hard drive will suffice.

spacebard
Jan 1, 2007

Football~

Love Stole the Day posted:

Does anyone know how I can create a new dictionary extension for Firefox similar to Rikaichan's https://addons.mozilla.org/en-US/firefox/addon/rikaichan-jpen/ JPN-ENG dictionary add-on? I don't know where to look to locate the actual thing here so that I can modify it. I want to create a KOR-ENG dictionary extension so that I can use Rikaichan but for Korean.

I think I'm competent enough with JS or whatever language Firefox extensions use here in order to get this done... I just don't know where to look and I was hoping someone in this thread would know what direction I need to go in. You don't have to write an effortpost or whatever for me, just an informative link or a file path to where I can find the extension's source code in my hard drive will suffice.

You should be able to find the source code for an add-on in your profile/extensions directory. The xpi file is a zip.

I think you would need to implement a content script to add an event listener on hover. I can't remember how much Mozilla hates content scripts that are set for every page. There's also a context menu module that might be useful for say grabbing a selection of words and passing it over to your script, and then use the panel module to display it. In any case you can start with the Jetpack tool, jpm, on the Getting Started page.

Erika
Feb 6, 2013

by FactsAreUseless
Hey, I asked on some website for hiring web developers, I just wanted some small addition to a wordpress widget that shows latest posts: making it show the author as well, beside the date; and they're asking like $200 the work, is this normal?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Little Bitch Man posted:

Hey, I asked on some website for hiring web developers, I just wanted some small addition to a wordpress widget that shows latest posts: making it show the author as well, beside the date; and they're asking like $200 the work, is this normal?

Honestly doesn't sound too crazy. I don't like to short change small jobs for cheap because the time always runs bad on them. You'll probably find people willing to run cheaper but I'd never take a job with a non existing client for a project less than $200 (mind you I'm thinking in Australian money), so I guess that's more like $350 AUD... Either way, costs are costs, good developers charge what they're worth because they get it done in a quarter of the time with less/no bugs. Get references if you're concerned because the stuff they do MAY be straightforward, however Wordpress Development usually incurs a bit of a tax as it's just not pleasant nor sensible to work with in many regards, forcing you to chase errors longer than expected.

A more experienced Wordpress dev could probably get it done cheaper, but depends on their hourly rate too. Remember they may be factoring in the discussion you're having right now too, hard to make money on a job if it cost you an hour of discussion before you even started getting paid.

fuf
Sep 12, 2004

haha

Little Bitch Man posted:

Hey, I asked on some website for hiring web developers, I just wanted some small addition to a wordpress widget that shows latest posts: making it show the author as well, beside the date; and they're asking like $200 the work, is this normal?

Even the smallest / easiest jobs can end up being nightmares, especially with weirdly-coded WP plugins. Quoting is always risky so developers learn to err on the side of caution. But I guess that does sound a little steep if the job is as simple as you describe.

p.s.: anyone have a recommendation for self-hosted CRM software before I install and get to grips with https://suitecrm.com/ ?

fuf fucked around with this message at 12:37 on Sep 7, 2016

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I have a hard time doing any job for less than $200 when I account for support, ironing out specs and expectations, costs of context-switching between jobs, etc.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



BJPaskoff posted:

It doesn't happen often, but when it does.... So, where's the best place to catch up and learn about new stuff?

You should ask about it ITT. Usually someone will at least have a link to a blog post they keep around to refresh their memory. You might even get some good effort posts - who knows.

Nobody knows all of this crap, so you're hardly alone in wondering.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Does anyone have any opinion on using Rollbar for client side JS error logging? Any strong opinions on other providers for this type of service?

Depressing Box
Jun 27, 2010

Half-price sideshow.
I don't know about Rollbar specifically, but we've been using Bugsnag at work and it's been invaluable.

Rather than having to work backwards from user reports, I get a notification with a link to the error report, a full stack trace (resolved with the source map), a bunch of user/device/session data, and one click to create a linked issue in our issue tracking system.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I've used papertrail and the like with javascript clients to monitor logs and errors. It's actually pretty great.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
I'm on a quest to incorporate TypeScript into a traditional server-rendered website. I've got Webpack set up to transpile .ts files into corresponding .js, ES5 CommonJS modules. My goal is to have a single .js file for each page in the app as a way of lazily namespacing this stuff. Unfortunately, I'm having issues where declared methods are inaccessible to the DOM after transpilation.

For example, this TypeScript:

code:
function paste(event) {
	console.log('pasted', event);
}
Gets transpiled into this lovely bit of ES5:

JavaScript code:
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	__webpack_require__(1);
	function paste(event) {
	    console.log('pasted', event);
	}


/***/ },
/* 1 */
/***/ function(module, exports) {

	// removed by extract-text-webpack-plugin

/***/ }
/******/ ]);
//# sourceMappingURL=global.js.map
The issue I'm having is that, when I try to call paste() via an element's onpaste event (for example <body onpaste="paste()">), the page complains that "paste is not defined".

How am I supposed to write (and transpile) TypeScript so that I can define event handlers within the HTML? I know that it's possible to declare event handlers on elements programmatically within a closure, and they'll fire just fine. However, that means that all handler declarations have to take place in Javascript, and so I'd lose the ability to scan the HTML and see when Javascript is being called. I just can't imagine not being able to declare event handlers within the HTML, but maybe that's an old-school way of approaching this?

IAmKale fucked around with this message at 07:38 on Sep 8, 2016

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I'm gonna be the guy that says 'you're doing it wrong'. If you want typing to join HTML and JavaScript use React. Matching HTML with JavaScript by calling directly from the HTML elements is generally a very brittle repetitive way to approach things. Best practice dictates that your base HTML document should be mostly usable without a lick of JavaScript, with the JavaScript laying over the top like a new layer of functionality.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Maluco Marinero posted:

Best practice dictates that your base HTML document should be mostly usable without a lick of JavaScript, with the JavaScript laying over the top like a new layer of functionality.
Okay, I suspected as much. Truth be told, I'm an Angular guy and so I've been attempting to recreate some of the SPA "magic" in a server-rendered website. Until now I figured it would relatively easy to replace Angular's (click) tags with standard HTML onclick declarations. I'll stop fighting Webpack and just adjust my mentality to, as you said, incorporate Javascript as an additional layer over top of the functional, plain HTML.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



IAmKale posted:

I'm on a quest to incorporate TypeScript into a traditional server-rendered website. I've got Webpack set up to transpile .ts files into corresponding .js, ES5 CommonJS modules. My goal is to have a single .js file for each page in the app as a way of lazily namespacing this stuff. Unfortunately, I'm having issues where declared methods are inaccessible to the DOM after transpilation.

<snip>

How am I supposed to write (and transpile) TypeScript so that I can define event handlers within the HTML? I know that it's possible to declare event handlers on elements programmatically within a closure, and they'll fire just fine. However, that means that all handler declarations have to take place in Javascript, and so I'd lose the ability to scan the HTML and see when Javascript is being called. I just can't imagine not being able to declare event handlers within the HTML, but maybe that's an old-school way of approaching this?

Transpiling your function from TS would look exactly the same in JS. Most of that is Webpack's module machinery which you might have to break out of manually by setting window.paste = function paste. If you really want to do it that way, anyway.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Munkeymon posted:

Transpiling your function from TS would look exactly the same in JS. Most of that is Webpack's module machinery which you might have to break out of manually by setting window.paste = function paste. If you really want to do it that way, anyway.
Yeah, that had me really frustrated last night. Going forward, I'm going to working within the boundaries of closures and declare event handlers within Javascript. I was trying to avoid leaking global variables and whatnot anyway, might as well go all the way with that ideology.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

IAmKale posted:

Yeah, that had me really frustrated last night. Going forward, I'm going to working within the boundaries of closures and declare event handlers within Javascript. I was trying to avoid leaking global variables and whatnot anyway, might as well go all the way with that ideology.

Are you using Webpack because you want to bundle a bunch of CommonJS/ES6 modules, or just to do the TypeScript compile step? There are a lot simpler ways to get what you want. Specifically, you could just take myfile.ts, run it through tsc (the actual TypeScript compiler), get myfile.js, and it will work just as you expect it to work now. To use with Webpack, you need to jump through a few more hoops to get what you want.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Skandranon posted:

Are you using Webpack because you want to bundle a bunch of CommonJS/ES6 modules, or just to do the TypeScript compile step? There are a lot simpler ways to get what you want. Specifically, you could just take myfile.ts, run it through tsc (the actual TypeScript compiler), get myfile.js, and it will work just as you expect it to work now. To use with Webpack, you need to jump through a few more hoops to get what you want.
I work with Django alot so my goal was to enable the use of TypeScript and SCSS in traditional Django apps. Staying focused on TS for now, I envisioned a setup in which I could create a .ts file, transpile it into ES5, and then <script src=""> these individual .js files within their respective pages' templates (so the Homepage would include an index.js file, About would have an about.js, etc...) That way I could keep things "modularized" but still define functions globally per page so I could attach event handlers within HTML.

Webpack wants to wrap everything into a CommonJS module (for sake of discussion), though, and so it's forcing me to write classes and define event handlers programmatically when all I want to do is define a couple of basic functions per page.

For reference, here's a Github repo I created that contains the results of my research into incorporating TypeScript and SCSS into Django: https://github.com/MasterKale/dts-webpack. Webpack just seemed like a sane way to go about this especially considering my desire to handle SCSS, Webpack's relative popularity, and my plan to incorporate unit testing into my Javascript.

Edit: Oh, and I wanted live compilation of this stuff too (e.g. running webpack --watch)

IAmKale fucked around with this message at 17:58 on Sep 8, 2016

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Webpack is very opinionated, so if all you want is something you can configure to watch for file changes, run a transpiler per file and get the hell out of the way otherwise, you probably want Grunt.

Or write a quick Python script since it's probably less of a learning curve if you already know and use Python.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

IAmKale posted:

I work with Django alot so my goal was to enable the use of TypeScript and SCSS in traditional Django apps. Staying focused on TS for now, I envisioned a setup in which I could create a .ts file, transpile it into ES5, and then <script src=""> these individual .js files within their respective pages' templates (so the Homepage would include an index.js file, About would have an about.js, etc...) That way I could keep things "modularized" but still define functions globally per page so I could attach event handlers within HTML.

Webpack wants to wrap everything into a CommonJS module (for sake of discussion), though, and so it's forcing me to write classes and define event handlers programmatically when all I want to do is define a couple of basic functions per page.

For reference, here's a Github repo I created that contains the results of my research into incorporating TypeScript and SCSS into Django: https://github.com/MasterKale/dts-webpack. Webpack just seemed like a sane way to go about this especially considering my desire to handle SCSS, Webpack's relative popularity, and my plan to incorporate unit testing into my Javascript.

Edit: Oh, and I wanted live compilation of this stuff too (e.g. running webpack --watch)

For your case, I would probably dump WebPack, and use TypeScript internal modules to organize your code. Then you can concat it all together into "scripts.js", include in every page consistantly, and then address your functions by their module, so "About.stuff()", "Index.indexstuff()".

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Skandranon posted:

For your case, I would probably dump WebPack, and use TypeScript internal modules to organize your code. Then you can concat it all together into "scripts.js", include in every page consistantly, and then address your functions by their module, so "About.stuff()", "Index.indexstuff()".
You know what, this is working out way better than I thought. tsc --out app.js --watch and I'm in business, subdirectories included. And like you said I can do About.foo() or Index.bar() within my HTML to target specific modules.

On that note, if I'm using an external library like, say, axios and include it in <head> with a <script src="">, how can I, within a module, tell TypeScript that axios exists globally? Right now tsc is processing my scripts, but not without complaining that axios doesn't exist. The transpiled ES5 calls axios successfully, so I know that things are working, but I'd still like to figure out the "proper" way of informing TS about situations like this.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

IAmKale posted:

You know what, this is working out way better than I thought. tsc --out app.js --watch and I'm in business, subdirectories included. And like you said I can do About.foo() or Index.bar() within my HTML to target specific modules.

On that note, if I'm using an external library like, say, axios and include it in <head> with a <script src="">, how can I, within a module, tell TypeScript that axios exists globally? Right now tsc is processing my scripts, but not without complaining that axios doesn't exist. The transpiled ES5 calls axios successfully, so I know that things are working, but I'd still like to figure out the "proper" way of informing TS about situations like this.

This is what TypeScript definition (d.ts) files are for. They are files which define interfaces for an object, but do not contain code. So for example, you can get a definition file for Lodash, and it will a) tell TypeScript there is a global _ object, and b) tell TypeScript what functions are on there and their signature, so it can check if you are making any obvious type errors. They also provide intellisense to things like VSCode.

You can find d.ts files for most major libraries here.

https://github.com/DefinitelyTyped/DefinitelyTyped

You can also write your own if you are unlucky enough to be using a library that has not had one made for it.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Skandranon posted:

This is what TypeScript definition (d.ts) files are for. They are files which define interfaces for an object, but do not contain code. So for example, you can get a definition file for Lodash, and it will a) tell TypeScript there is a global _ object, and b) tell TypeScript what functions are on there and their signature, so it can check if you are making any obvious type errors. They also provide intellisense to things like VSCode.
Okay, I'm somewhat familiar with those. There must be something up with this axios.d.ts file, then, because I have a require.d.ts sitting right next to it that TypeScript recognizes no problem.

So I've created NPM scripts for TS and SCSS watching, and integrated parallelshell into a third script to run both commands simultaneously. This is basically the perfect setup now, I'm really happy with how this turned out. Thanks for your help, Skandranon and everyone else!

Gul Banana
Nov 28, 2003

the former "internal modules" are called namespaces in 2.0, right? I might try a similar approach for building a library that wants to expose lots of different types and needs some structure

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Odd question; I'm doing some side-work for a startup company (retail/brick and mortar, not internet, they already have 2 locations) and I'm bothered by their email signatures. They are big, ugly, clunky, and look like crap when quoted in gmail or in a webmail client (e.g. HORDE). Normally I wouldn't care as much, but they've also requested that I start putting an approved sig block on my own emails when using me@theircompany.com.

So the question is; are HTML email signatures "solved" yet? Responsive? Less broken images? Doesn't add a half dozen attachments to the email? Works on phones, gmail, etc?

I found these two paid options, which I'm not willing to pay for:
https://www.zippysig.com/
http://medialoot.com/item/responsive-email-signature-template/

And this crazy npm package which requires installing a bunch of stuff seems overkill:
https://www.npmjs.com/package/responsive-html-email-signature

As well as numerous "free" generators that are too simplistic/look like crap.

Is there some kind of known good solution, or just crap something out by running it through a MailChimp template or something? I'm not afraid to make my own, but just want to know if there's a firm set of rules about how you actually do it.

Anony Mouse
Jan 30, 2005

A name means nothing on the battlefield. After a week, no one has a name.
Lipstick Apathy
The concept of email signatures is awful enough without throwing HTML into the mix, especially email HTML, which is still hot garbage. Stick to plaintext, but if you must do HTML, check out Zurb Foundation. I had an email project recently and wasted way too many hours trying to hack Mailchimp's poo poo before giving up and doing what I needed with Zurb in about 30 minutes.

joebuddah
Jan 30, 2005
How do I download a datatables table with the images? I have a table that is generated by the datatable plugin based on a sql query. Everything works except I cant get the images to download with the pdf file. Does anyone know how I can fix this?

code:
<!doctype html>

<?php
error_reporting(E_ALL);
$serverName = "myserver";
$connectionOptions = array("Database"=>"mydb");
$conn = sqlsrv_connect( $serverName, $connectionOptions);

$tsql = "SELECT col1,col2,photoname FROM mytable ";  
$stmt = sqlsrv_query( $conn, $tsql);    

error_reporting(E_ALL); 

?>

<link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="/js/jquery.js"></script>
<script type="text/javascript" charset="utf8"                      src="/js/jquery.dataTables.min.js"></script>
 <script type="text/javascript" charset="utf8"     src="/js/dataTables.buttons.min.js"></script>
 <script type="text/javascript" charset="utf8" src="/build/pdfmake.min.js">        </script>
 <script type="text/javascript" charset="utf8" src="/build/vfs_fonts.js">    </script>
 <script type="text/javascript" charset="utf8"     src="/js/buttons.html5.min.js"></script>


<script>
 $(document).ready(function() {
    $('#example').DataTable( {
       dom: 'Bfrtip',
       buttons: [
            {
                extend: 'pdfHtml5',
                customize: function ( doc ) {
                    doc.content.splice( 1, 0, {
                        margin: [ 0, 0, 0, 12 ],
                        alignment: 'center',
                                            } );
                }
            }
        ]
    } );
} );       
</script>       
<table id="example">
    <thead>
      <tr>
        <th>col1</th>
    <th>Col2</th>
    <th>Photoname</th>
    </tr>
    </thead>
    <tbody>
    <?php
    error_reporting(E_ALL); 
    while($row = sqlsrv_fetch_array ($stmt )){
    ?>
    <tr>

<td><?=$row['col`']?></td>
<td><?=$row['col2']?></td>
<td><?php echo "image:{'data"?><img src = '/images/<?=$row['photoname']?>'height="200" width="200"/><?php echo "'}"?></td>

</tr>           

<?php
error_reporting(E_ALL); 
}
?>

melon cat
Jan 21, 2010

Nap Ghost
Is this the best thread to ask a Wordpress-related question? I have my first-ever, live client who needs a website completely re-done. We're leaning towards setting up a premium Wordpress.org theme. I've done this for close friends and family members before (set up the domain name, hosting, install Wordpress.org... all that), but this is the first time that I've ever done this for a "real", professional client who already has their own website and hosting.

So I have a few questions:
  • I've heard that the best way to set up a WP site for a client is to set up the site in its own sub-folder on my own hosting. Then, once everything is approved and good to go copy the client's files and database files and transfer them to the client's hosting server. I've never done anything like this before. How do I do this properly? And how do I transfer a WP website from my test environment over to the client's outside hosting?
  • How do you guys normally charge for this type of job? By the hour? A certain amount of $$ per job?
  • Any tips for making sure my first ever Wordpress client project goes smoothly?

I realize that my questions are very... rookie. But my biggest concern is setting up the test environment, then transferring it over to the client in a smooth, seamless way. Really excited, but also don't want to screw this up!

melon cat fucked around with this message at 05:23 on Sep 17, 2016

Xik
Mar 10, 2011

Dinosaur Gum

joebuddah posted:

How do I download a datatables table with the images? I have a table that is generated by the datatable plugin based on a sql query. Everything works except I cant get the images to download with the pdf file. Does anyone know how I can fix this?

Based on what you've provided you are storing the filename (including extension [.jpg,.png w/e]) of the image in the database. The images themselves are external and should be in [script location]/images/ directory.
Do those images actually exist at that location and is the data in the photoname column accurate?

(I haven't actually touched PHP since Uni so can't really verify there aren't obvious syntax issues)

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

melon cat posted:

Is this the best thread to ask a Wordpress-related question? I have my first-ever, live client who needs a website completely re-done. We're leaning towards setting up a premium Wordpress.org theme. I've done this for close friends and family members before (set up the domain name, hosting, install Wordpress.org... all that), but this is the first time that I've ever done this for a "real", professional client who already has their own website and hosting.

So I have a few questions:
  • I've heard that the best way to set up a WP site for a client is to set up the site in its own sub-folder on my own hosting. Then, once everything is approved and good to go copy the client's files and database files and transfer them to the client's hosting server. I've never done anything like this before. How do I do this properly? And how do I transfer a WP website from my test environment over to the client's outside hosting?
  • How do you guys normally charge for this type of job? By the hour? A certain amount of $$ per job?
  • Any tips for making sure my first ever Wordpress client project goes smoothly?

I realize that my questions are very... rookie. But my biggest concern is setting up the test environment, then transferring it over to the client in a smooth, seamless way. Really excited, but also don't want to screw this up!

There is a dedicated WordPress thread in this forum. I am phone posting so I am too lazy to link it for you, but you will likely get a faster and better response there.

joebuddah
Jan 30, 2005

Xik posted:

Based on what you've provided you are storing the filename (including extension [.jpg,.png w/e]) of the image in the database. The images themselves are external and should be in [script location]/images/ directory.
Do those images actually exist at that location and is the data in the photoname column accurate?

(I haven't actually touched PHP since Uni so can't really verify there aren't obvious syntax issues)

The photos exist and are located in a /images dir. The column name is photoname, and they are
Jpgs

fuf
Sep 12, 2004

haha

melon cat posted:

Is this the best thread to ask a Wordpress-related question? I have my first-ever, live client who needs a website completely re-done. We're leaning towards setting up a premium Wordpress.org theme. I've done this for close friends and family members before (set up the domain name, hosting, install Wordpress.org... all that), but this is the first time that I've ever done this for a "real", professional client who already has their own website and hosting.

So I have a few questions:
  • I've heard that the best way to set up a WP site for a client is to set up the site in its own sub-folder on my own hosting. Then, once everything is approved and good to go copy the client's files and database files and transfer them to the client's hosting server. I've never done anything like this before. How do I do this properly? And how do I transfer a WP website from my test environment over to the client's outside hosting?
  • How do you guys normally charge for this type of job? By the hour? A certain amount of $$ per job?
  • Any tips for making sure my first ever Wordpress client project goes smoothly?

I realize that my questions are very... rookie. But my biggest concern is setting up the test environment, then transferring it over to the client in a smooth, seamless way. Really excited, but also don't want to screw this up!

  • Yes this is a good way to do it. It means you can show the client the "dev" version of the site before anything is actually live. But you'd be better off installing it on a subdomain of your current hosting, rather than a subdirectory, just because WP behaves slightly differently if it's in a subfolder. Your hosting control panel should let you add subdomains. Also client.yourdomain.com looks slightly better than yourdomain.com/client imo.

    When you're ready to transfer, I recommend you use the "Duplicator" plugin - http://lifeinthegrid.com/labs/duplicator/
    Install it on your dev version of WP and create a site package, then upload this to your client's hosting server and go to clientdomain.com/install.php
    The only thing you need to do on the client hosting is set up a database.

    Note that you can't just manually copy over the site files and database to the client's hosting because WP stores the site URL in a few places in the DB, so the DB needs to be updated with the new URL (Duplicator does this for you).

  • Charging by the hour is ideal but with small clients the first thing they ask is "ok, so how many hours will it take?" in which case you might as well have given them a fixed cost. If you can get them to agree to a range of hours ("it will take between 4 and 6 hours") then you give yourself a bit of flexibility. If it's a long term client and you come in under your estimate a few times then you earn some good will for the times you inevitably go over.

  • Pick the theme carefully. It's always a balance between flexibility and bloat. Sometimes a theme demo can look amazing but making even the tiniest change requires hacking away at the code in which case you're not really saving any time.

Congrats on the job :)

Adbot
ADBOT LOVES YOU

melon cat
Jan 21, 2010

Nap Ghost

Lumpy posted:

There is a dedicated WordPress thread in this forum. I am phone posting so I am too lazy to link it for you, but you will likely get a faster and better response there.

Ah! Found it. Must've overlooked it the first time around. I'll ask this question there. :)

fuf posted:

  • Yes this is a good way to do it. It means you can show the client the "dev" version of the site before anything is actually live. But you'd be better off installing it on a subdomain of your current hosting, rather than a subdirectory, just because WP behaves slightly differently if it's in a subfolder. Your hosting control panel should let you add subdomains. Also client.yourdomain.com looks slightly better than yourdomain.com/client imo.

[snip]
Hey thanks a lot for this information! I never considered installing it on a subdomain, but will consider doing that.

Also- I've been told that WP Engine might be a viable approach for what I'm trying to do. For the sake of simplicity (and stability) would it better to go with your suggested approach, or consider doing this through WP Engine?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply